@Test
public void whichClasses() throws Exception {

    // load from context loader
    assertEquals(0, ClassLoaderUtil.whichClasses(null).length);
    assertEquals(0, ClassLoaderUtil.whichClasses("aaa.NotExistClass").length);
    URL[] urls = ClassLoaderUtil.whichClasses("java.lang.String");
    assertUnique(urls);
    // load from class referrer
    assertEquals(0, ClassLoaderUtil.whichClasses(null, getClass()).length);
    assertEquals(0, ClassLoaderUtil.whichClasses(null, (Class<?>) null).length);
    assertEquals(0, ClassLoaderUtil.whichClasses("aaa.NotExistClass", getClass()).length);
    assertEquals(0, ClassLoaderUtil.whichClasses("aaa.NotExistClass", (Class<?>) null).length);
    urls = ClassLoaderUtil.whichClasses("java.lang.String", getClass());
    assertUnique(urls);
    urls = ClassLoaderUtil.whichClasses("java.lang.String", (Class<?>) null);
    assertUnique(urls);
    // load from specified loader
    assertEquals(0, ClassLoaderUtil.whichClasses(null, getClass().getClassLoader()).length);
    assertEquals(0, ClassLoaderUtil.whichClasses(null, (ClassLoader) null).length);
    assertEquals(0, ClassLoaderUtil.whichClasses("aaa.NotExistClass", getClass().getClassLoader()).length);
    assertEquals(0, ClassLoaderUtil.whichClasses("aaa.NotExistClass", (ClassLoader) null).length);
    urls = ClassLoaderUtil.whichClasses("java.lang.String", getClass().getClassLoader());
    assertUnique(urls);
    urls = ClassLoaderUtil.whichClasses("java.lang.String", (ClassLoader) null);
    assertUnique(urls);
}