Better (but unsorted) Java detection