I have a List. I want to get the index of the (first) user in the stream with a particular username. I don\'t want to actually require the Us
List
Us
Try This:
IntStream.range(0, users.size()) .filter(userInd-> users.get(userInd).getName().equals(username)) .findFirst() .getAsInt();