ResourceList { public boolean hasClass(String className) { return getCache().mapClassToCP.containsKey(className); } private  ResourceList(ClassLoader classLoader); static ResourceList getInstance(ClassLoader classLoader); void resetCache(); static void resetAllCaches(); boolean hasClass(String className); InputStream getClassAsStream(String name); Set<String> getAllClasses(String classPathEntry, boolean includeInternalClasses); Set<String> getAllClasses(String classPathEntry, String prefix, boolean includeInternalClasses); Set<String> getAllClasses(String classPathEntry, String prefix, boolean includeInternalClasses, boolean excludeAnonymous); static boolean isInterface(String resource); boolean isClassAnInterface(String className); boolean isClassDeprecated(String className); boolean isClassTestable(String className); static String getClassNameFromResourcePath(String resource);  }
@Test public void testHasClass(){ Assert.assertTrue(ResourceList.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).hasClass(Foo.class.getName())); Assert.assertTrue(ResourceList.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).hasClass(SubPackageFoo.class.getName())); }