SwissKnife { public static boolean doesClassExist(String nameWithPackage, Object instanceToGetClassloaderFrom) { boolean exists = false; try { Class.forName(nameWithPackage, false, instanceToGetClassloaderFrom.getClass().getClassLoader()); exists = true; } catch (ClassNotFoundException e) { exists = false; } return exists; }  static PropertiesConfiguration loadConfigurationInUtf8(String fileOrUrlOrClasspathUrl); static String getRealClassNameLowerCamelCase(Object object); static boolean doesClassExist(String nameWithPackage, Object instanceToGetClassloaderFrom);  }
@Test public void testDoesClassExist() { assertEquals(false, SwissKnife.doesClassExist("sdfsfasdf.sadfasdfasdf.asdfasfasdf", this)); assertEquals(true, SwissKnife.doesClassExist("java.lang.String", this)); }