I guess the compareTo
method works the other way round for String
s, so maybe try
while(current != null && current.lastName.compareTo(lastName) <= 0)
But I recommend you to use just the Compareable
interface and sort the list by using Collections.sort(yourlist)