You can add labels to your loop, and use that labelled break to break out of the appropriate loop: -
outer: for (...) {
inner: for(...) {
if (someCondition) {
break outer;
}
}
}
See these links for more information:
- Branching Statements
- JLS - Break Statement