public static boolean hasCycle(ListNode head){
        if(head == null){
            return false;
        }
        if(head.next == null){
            return true;
        }

        ListNode slowPoint = head;
        ListNode fastNode = head;

        while (fastNode != null && fastNode.next != null){
            slowPoint = slowPoint.next;
            fastNode = fastNode.next.next;
            if(fastNode == slowPoint){
                return true;
            }
        }
        return  false;
    }