Detecting a cycle in a linked list using Java
The method should be public.

Testing for the current.next != null condition is unnecessary. Also, consider writing the loop as a for loop for clarity:

for (Node current = head; current != null; current = current.next) {
    …
}


You don't need to call seen.contains(), because seen.add() will return false if the item you are adding is already in the set.