### Question:
ApplicationClassLoader extends URLClassLoader { @VisibleForTesting static boolean isSystemClass(String name, List<String> systemClasses) { if (systemClasses != null) { String canonicalName = name.replace('/', '.'); while (canonicalName.startsWith(".")) { canonicalName=canonicalName.substring(1); } for (String c : systemClasses) { boolean result = true; if (c.startsWith("-")) { c = c.substring(1); result = false; } if (c.endsWith(".") && canonicalName.startsWith(c)) { return result; } else if (canonicalName.equals(c)) { return result; } } } return false; } 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);  }### Answer:
@Test public void testIsSystemClass() { assertFalse(isSystemClass("org.example.Foo", null)); assertTrue(isSystemClass("org.example.Foo", classes("org.example.Foo"))); assertTrue(isSystemClass("/org.example.Foo", classes("org.example.Foo"))); assertTrue(isSystemClass("org.example.Foo", classes("org.example."))); assertTrue(isSystemClass("net.example.Foo", classes("org.example.,net.example."))); assertFalse(isSystemClass("org.example.Foo", classes("-org.example.Foo,org.example."))); assertTrue(isSystemClass("org.example.Bar", classes("-org.example.Foo.,org.example."))); }