I have a program that runs chaining methods
MyObject o = MyObject.getInstance().method1().method2().go();
Now, this instance returns multiple lines of data,
I can execute them in a loop but I would rather do this:
MyObject o = MyObject.getInstance().foreach().method1().method2().go();
I.e used a for each
is it possible in Java to do this?