### Question:
AbstractCriteriaLookupManager extends AbstractLookupManager<I, T, R> { protected Collection<String> toCollection(final String s) { if (s != null && !s.startsWith(COLLECTION_START_CHAR)) { return new HashSet<>(0); } else if (s != null && s.startsWith(COLLECTION_START_CHAR) && s.endsWith(COLLECTION_END_CHAR)) { final String toParse = s.substring(1, s.length() - 1); final String[] parsed = toParse.split(COLLECTION_DELIMITER); final HashSet<String> result = new HashSet<>(parsed.length); for (String p : parsed) { result.add(p.trim()); } return result; } return new HashSet<>(0); }  static Map<String, String> parseCriteria(final String criteria); static String[] parseCriteriaPair(final String criteria);  }### Answer:
@Test public void checkToSet_NullSet() { assertEquals(Collections.emptySet(), manager.toCollection(null)); }
@Test public void checkToSet_EmptySet() { assertEquals(Collections.emptySet(), manager.toCollection("")); }
@Test public void checkToSet_NoCollectionDelimiters() { assertEquals(Collections.emptySet(), manager.toCollection("label")); }
@Test public void checkToSet_NoCollectionStartDelimiter() { assertEquals(Collections.emptySet(), manager.toCollection("label]")); }
@Test public void checkToSet_NoCollectionEndDelimiter() { assertEquals(Collections.emptySet(), manager.toCollection("[label")); }
@Test public void checkToSet_SingleValue() { final Collection<String> set = manager.toCollection("[label1]"); assertEquals(1, set.size()); assertTrue(set.stream().anyMatch(s -> s.equals("label1"))); }
@Test public void checkToSet_MultipleValues() { final Collection<String> set = manager.toCollection("[label1,label2]"); assertEquals(2, set.size()); assertTrue(set.stream().anyMatch(s -> s.equals("label1"))); assertTrue(set.stream().anyMatch(s -> s.equals("label2"))); }