@Test void testReverseList() { IntegerNode head = LinkedListFactory.newLinkedList(); for (IntegerNode current = head; current != null; current = current.next()) { System.out.printf("%s%s", current.toString(), current.next() == null ? "\n" : "--->"); } head = JackOfAllTrades.reverseList(head); for (IntegerNode current = head; current != null; current = current.next()) { System.out.printf("%s%s", current.toString(), current.next() == null ? "\n" : "--->"); } }
public static IntegerNode reverseList(IntegerNode head) { IntegerNode first = reverse(head.next(), head); return IntegerNode.builder() .next(first) .build(); }
JackOfAllTrades { public static IntegerNode reverseList(IntegerNode head) { IntegerNode first = reverse(head.next(), head); return IntegerNode.builder() .next(first) .build(); } }
JackOfAllTrades { public static IntegerNode reverseList(IntegerNode head) { IntegerNode first = reverse(head.next(), head); return IntegerNode.builder() .next(first) .build(); }  }
JackOfAllTrades { public static IntegerNode reverseList(IntegerNode head) { IntegerNode first = reverse(head.next(), head); return IntegerNode.builder() .next(first) .build(); }  static IntegerNode reverseList(IntegerNode head); }
JackOfAllTrades { public static IntegerNode reverseList(IntegerNode head) { IntegerNode first = reverse(head.next(), head); return IntegerNode.builder() .next(first) .build(); }  static IntegerNode reverseList(IntegerNode head);  }