Lists { public static <T> List<T> subList(List<T> list, int startIndex) { return list.subList(startIndex, list.size()); }  static T add(Collection<T> list, T element); static List<T> subList(List<T> list, int startIndex); static ArrayList<T> subList(List<T> list, int startIndex, int endIndex); @SafeVarargs static void sort(Comparator<T> comparator, List<? extends T>... collections); static List<T> reverse(List<T> list); static List<T>[] split(List<T> list, T delimiter); @SafeVarargs static List<T> mutableOf(T... elements); static T get(List<T> list, int index);  }
@Test void subList() { List<String> subList = Lists.subList(LIST, 1); Assertions.assertEquals(Arrays.asList("b", "c"), subList); ArrayList<String> mutList = Lists.subList(LIST, 0, LIST.size()); for (String element : LIST) { Assertions.assertDoesNotThrow(() -> mutList.add(element)); } Assertions.assertEquals(Arrays.asList("a", "b", "c", "a", "b", "c"), mutList); }