diff -r b2fd2388dd46 -r 4e29b285c723 langtools/test/tools/javac/lambda/lambdaExecution/TBlock.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/lambda/lambdaExecution/TBlock.java Tue Nov 20 09:58:55 2012 -0800 @@ -0,0 +1,36 @@ +/** + * Performs operations upon an input object which may modify that object and/or + * external state (other objects). + * + *

All block implementations are expected to: + *

+ * + * @param The type of input objects to {@code apply}. + */ +public interface TBlock { + + /** + * Performs operations upon the provided object which may modify that object + * and/or external state. + * + * @param t an input object + */ + void apply(T t); + + /** + * Returns a Block which performs in sequence the {@code apply} methods of + * multiple Blocks. This Block's {@code apply} method is performed followed + * by the {@code apply} method of the specified Block operation. + * + * @param other an additional Block which will be chained after this Block + * @return a Block which performs in sequence the {@code apply} method of + * this Block and the {@code apply} method of the specified Block operation + */ + public default TBlock chain(TBlock other) { + return (T t) -> { apply(t); other.apply(t); }; + } +}