### Question:
Utils { static Set<Class<?>> parseTypes(final String types, final ClassLoader classLoader) { final Set<Class<?>> result = new LinkedHashSet<>(); for (final String token : StringUtils.splitByWholeSeparatorPreserveAllTokens(types, ",")) { try { result.add(ClassUtils.getClass(classLoader, token.trim().replace('/', '.'))); } catch (final ClassNotFoundException e) { throw new IllegalArgumentException(e); } } return result; } private  Utils();   }### Answer:
@Test public void testParseTypes() { assertContainsInOrder(Utils.parseTypes(" java.lang.Number ", getClass().getClassLoader()), Number.class); assertContainsInOrder( Utils.parseTypes("java.lang.Number,java.lang.String,java.util.Map", getClass().getClassLoader()), Number.class, String.class, Map.class); assertContainsInOrder( Utils.parseTypes("java.lang.Number, java.lang.String, java.util.Map", getClass().getClassLoader()), Number.class, String.class, Map.class); assertContainsInOrder( Utils.parseTypes("java/lang/Number, java/lang/String, java/util/Map", getClass().getClassLoader()), Number.class, String.class, Map.class); assertContainsInOrder( Utils.parseTypes("java.lang.Number,\njava.lang.String,\njava.util.Map", getClass().getClassLoader()), Number.class, String.class, Map.class); }
@Test(expected = IllegalArgumentException.class) public void testParseUnknownType() { Utils.parseTypes("gobbledygook", getClass().getClassLoader()); }
@Test(expected = IllegalArgumentException.class) public void testParseMissingFirstType() { Utils.parseTypes(",java.lang.Object", getClass().getClassLoader()); }
@Test(expected = IllegalArgumentException.class) public void testParseMissingLastType() { Utils.parseTypes("java.lang.Object,", getClass().getClassLoader()); }
@Test(expected = IllegalArgumentException.class) public void testParseMissingType() { Utils.parseTypes("java.lang.Object,,java.lang.Iterable", getClass().getClassLoader()); }