Solved LinkedListCycle in java