I\'ve got a nested loop construct like this:
for (Type type : types) { for (Type t : types2) { if (some condition) { // Do somethin
Java 8 Stream solution:
List types1 = ... List types2 = ... types1.stream() .flatMap(type1 -> types2.stream().map(type2 -> new Type[]{type1, type2})) .filter(types -> /**some condition**/) .findFirst() .ifPresent(types -> /**do something**/);