CollectionUtil { public static int clear(final Collection collection) { final int size = collection.size(); collection.clear(); return size; }  static int clear(final Collection collection); static List<String> toStringList(final Collection<T> collection); static String smartJoin(final Collection<T> collection,
        final Generator<T, String> stringGenerator, final String joiner); @SafeVarargs static C arrayToCollection(
        final Supplier<C> creator, final T... array); @Deprecated static Collection<String> toStringCollection(final String stringList); static String join(final Collection<T> collection, String joiner); static boolean containsIgnoreCase(final Collection<? extends String> collection,
        final String string);  }
@Test void clear() { final Collection<String> collection = new ArrayList<>(Arrays.asList("heLlO", "WorLd")); int cleared = CollectionUtil.clear(collection); Assertions.assertEquals(cleared, 2); Assertions.assertTrue(collection.isEmpty()); }