Longest Consecutive Sequence in Java