ApplicationClassLoader extends URLClassLoader { public static boolean isSystemClass(String name, List<String> systemClasses) { boolean result = false; if (systemClasses != null) { String canonicalName = name.replace('/', '.'); while (canonicalName.startsWith(".")) { canonicalName=canonicalName.substring(1); } for (String c : systemClasses) { boolean shouldInclude = true; if (c.startsWith("-")) { c = c.substring(1); shouldInclude = false; } if (canonicalName.startsWith(c)) { if ( c.endsWith(".") || canonicalName.length() == c.length() || canonicalName.length() > c.length() && canonicalName.charAt(c.length()) == '$' ) { if (shouldInclude) { result = true; } else { return false; } } } } } return result; } ApplicationClassLoader(URL[] urls, ClassLoader parent,
      List<String> systemClasses);  ApplicationClassLoader(String classpath, ClassLoader parent,
      List<String> systemClasses); @Override URL getResource(String name); @Override Class<?> loadClass(String name); static boolean isSystemClass(String name, List<String> systemClasses); static final String SYSTEM_CLASSES_DEFAULT; }
@Test public void testIsSystemClass() { testIsSystemClassInternal(""); }