### Question:
CollectionUtils { public static Map<String, String> stringToMap(String str, String separator) { return stringToMap(str, separator, ""); } private  CollectionUtils(); static Collection<T> subtract(Set<T> a, Set<T> b); static boolean isNotEmpty(Collection coll); static boolean isEmpty(Collection coll); static Map<String, String> stringToMap(String str, String separator); static Map<String, String> stringToMap(String str, String separator, String keyPrefix); static boolean equalLists(Collection<?> a, Collection<?> b); static boolean isEqualCollection(final Collection<?> a, final Collection<?> b); static Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll); static List<Map<String, Object>> getListByExclusion(List<T> originList, Set<String> exclusionSet);  }### Answer:
@Test public void stringToMap() { Map<String, String> a = CollectionUtils.stringToMap("a=b;c=d;", ";"); Assert.assertNotNull(a); Assert.assertTrue(a.size() == 2); a = CollectionUtils.stringToMap(null, ";"); Assert.assertTrue(a.isEmpty()); a = CollectionUtils.stringToMap("", ";"); Assert.assertTrue(a.isEmpty()); a = CollectionUtils.stringToMap("a=b;c=d", ""); Assert.assertTrue(a.isEmpty()); a = CollectionUtils.stringToMap("a=b;c=d", null); Assert.assertTrue(a.isEmpty()); a = CollectionUtils.stringToMap("a=b;c=d;e=f", ";"); Assert.assertEquals(3, a.size()); a = CollectionUtils.stringToMap("a;b=f", ";"); Assert.assertTrue(a.isEmpty()); a = CollectionUtils.stringToMap("a=b;c=d;e=f;", ";", "test"); Assert.assertEquals(3, a.size()); Assert.assertNotNull(a.get("testa")); }