@Test public void test_matchesAsPackage() { assertTrue(ClassMatcher.matchesAsPackage("hu.awm.MyClass", Collections.singletonList("hu.awm"))); assertTrue(ClassMatcher.matchesAsPackage("hu.awm.MyClass$InnerClass", Collections.singletonList("hu.awm"))); assertTrue(ClassMatcher.matchesAsPackage("hu.awm.MyClass$InnerClass$InnerInnerClass", Collections.singletonList("hu.awm"))); assertTrue(ClassMatcher.matchesAsPackage("hu.awm.MyClass", Arrays.asList("hu.something.else", "hu.awm"))); assertFalse(ClassMatcher.matchesAsPackage("hu.something.else.MyClass$InnerClass", Collections.singletonList("hu.awm"))); assertFalse(ClassMatcher.matchesAsPackage("hu.awm.MyClass", Collections.singletonList("hu.something.else"))); assertFalse(ClassMatcher.matchesAsPackage("hu.awm.MyClass", new ArrayList<String>())); }
static boolean matchesAsPackage(String classFqn, List<String> fqns) { for (String fqn : fqns) { if (classFqn.startsWith(fqn + ".")) { return true; } } return false; }
ClassMatcher { static boolean matchesAsPackage(String classFqn, List<String> fqns) { for (String fqn : fqns) { if (classFqn.startsWith(fqn + ".")) { return true; } } return false; } }
ClassMatcher { static boolean matchesAsPackage(String classFqn, List<String> fqns) { for (String fqn : fqns) { if (classFqn.startsWith(fqn + ".")) { return true; } } return false; } private  ClassMatcher(); }
ClassMatcher { static boolean matchesAsPackage(String classFqn, List<String> fqns) { for (String fqn : fqns) { if (classFqn.startsWith(fqn + ".")) { return true; } } return false; } private  ClassMatcher();  }
ClassMatcher { static boolean matchesAsPackage(String classFqn, List<String> fqns) { for (String fqn : fqns) { if (classFqn.startsWith(fqn + ".")) { return true; } } return false; } private  ClassMatcher();   }