boolean condition = false;
for (Type type : types) {
for (int i = 0; i < otherTypes.size && !condition; i ++) {
condition = true; // If your condition is satisfied
}
}
Use condition
as a flag for when you are done processing. Then the inner loop only continues on while the condition has not been met. Either way, the outer loop will keep on chuggin'.