Is it even possible?
Say you have
private Set names = new LinkedHashSet();
and Strings ar
Strings
Although not as efficient for the machine, this achieves it in one line:
int index = new ArrayList(names).indexOf("John");