@Test public void shouldReturnFalseWhenClassNameNull() { boolean isPresent = ClassUtils.isPresent(null ); assertThat(isPresent, is(false)); }
public static boolean isPresent(String clazzName) { if (StringUtils.isEmpty(clazzName)) { return false; } boolean isPresent; try { @SuppressWarnings("unused") Class<?> clazz = Class.forName(clazzName); isPresent = true; } catch (ClassNotFoundException e) { isPresent = false; } return isPresent; }
ClassUtils { public static boolean isPresent(String clazzName) { if (StringUtils.isEmpty(clazzName)) { return false; } boolean isPresent; try { @SuppressWarnings("unused") Class<?> clazz = Class.forName(clazzName); isPresent = true; } catch (ClassNotFoundException e) { isPresent = false; } return isPresent; } }
ClassUtils { public static boolean isPresent(String clazzName) { if (StringUtils.isEmpty(clazzName)) { return false; } boolean isPresent; try { @SuppressWarnings("unused") Class<?> clazz = Class.forName(clazzName); isPresent = true; } catch (ClassNotFoundException e) { isPresent = false; } return isPresent; }  }
ClassUtils { public static boolean isPresent(String clazzName) { if (StringUtils.isEmpty(clazzName)) { return false; } boolean isPresent; try { @SuppressWarnings("unused") Class<?> clazz = Class.forName(clazzName); isPresent = true; } catch (ClassNotFoundException e) { isPresent = false; } return isPresent; }  static boolean isPresent(String clazzName); }
ClassUtils { public static boolean isPresent(String clazzName) { if (StringUtils.isEmpty(clazzName)) { return false; } boolean isPresent; try { @SuppressWarnings("unused") Class<?> clazz = Class.forName(clazzName); isPresent = true; } catch (ClassNotFoundException e) { isPresent = false; } return isPresent; }  static boolean isPresent(String clazzName);  }