DependencyUtil { @SuppressWarnings("squid:S4248") public static boolean isIgnorable(String className) { if (className == null) { return true; } String name = className.replaceAll("/", ".") .replaceAll("\\[\\]", ""); return IGNORE_CLASSNAMES.contains(name) || name.startsWith("java.lang."); } private  DependencyUtil(); @SuppressWarnings("squid:S4248") // wants to move the RegExes into constants; would not help readability here. static boolean isIgnorable(String className);  }
@Test public void testIsIgnorable() { assertThat(DependencyUtil.isIgnorable("java.lang.Object"), is(true)); assertThat(DependencyUtil.isIgnorable("java.lang.String"), is(true)); assertThat(DependencyUtil.isIgnorable("B"), is(true)); assertThat(DependencyUtil.isIgnorable("int[][]"), is(true)); assertThat(DependencyUtil.isIgnorable("java.util.List"), is(false)); assertThat(DependencyUtil.isIgnorable(""), is(false)); }
@Test public void testIsIgnorableNoChecksForListEtc() { assertThat(DependencyUtil.isIgnorable("L[java.lang.Object"), is(false)); }
@Test public void testNullInput() { assertThat(DependencyUtil.isIgnorable(null), is(true)); }