Better java selection on multiple matches