@Test public void testIsSystemClass() throws URISyntaxException, IOException { ClassDumper classDumper = ClassDumper.create( ImmutableList.of(classPathEntryOfResource("testdata/guava-23.5-jre.jar"))); List<String> javaRuntimeClasses = ImmutableList.of( "java.lang.String", "java.lang.Object", "[Ljava.lang.String;", "java.util.ArrayList", "javax.net.SocketFactory"); for (String javaRuntimeClassName : javaRuntimeClasses) { Truth.assertThat(classDumper.isSystemClass(javaRuntimeClassName)).isTrue(); } List<String> nonJavaRuntimeClasses = ImmutableList.of("com.google.common.collect.ImmutableList", "foo.bar.Baz"); for (String nonJavaRuntimeClassName : nonJavaRuntimeClasses) { Truth.assertThat(classDumper.isSystemClass(nonJavaRuntimeClassName)).isFalse(); } }
boolean isSystemClass(String className) { try { if (isArrayClass(className)) { return true; } extensionClassLoader.loadClass(className); return true; } catch (ClassNotFoundException ex) { return false; } }
ClassDumper { boolean isSystemClass(String className) { try { if (isArrayClass(className)) { return true; } extensionClassLoader.loadClass(className); return true; } catch (ClassNotFoundException ex) { return false; } } }
ClassDumper { boolean isSystemClass(String className) { try { if (isArrayClass(className)) { return true; } extensionClassLoader.loadClass(className); return true; } catch (ClassNotFoundException ex) { return false; } } private  ClassDumper(
      List<ClassPathEntry> inputClassPath,
      ClassLoader extensionClassLoader,
      Map<String, ClassPathEntry> fileNameToClassPathEntry); }
ClassDumper { boolean isSystemClass(String className) { try { if (isArrayClass(className)) { return true; } extensionClassLoader.loadClass(className); return true; } catch (ClassNotFoundException ex) { return false; } } private  ClassDumper(
      List<ClassPathEntry> inputClassPath,
      ClassLoader extensionClassLoader,
      Map<String, ClassPathEntry> fileNameToClassPathEntry);  }
ClassDumper { boolean isSystemClass(String className) { try { if (isArrayClass(className)) { return true; } extensionClassLoader.loadClass(className); return true; } catch (ClassNotFoundException ex) { return false; } } private  ClassDumper(
      List<ClassPathEntry> inputClassPath,
      ClassLoader extensionClassLoader,
      Map<String, ClassPathEntry> fileNameToClassPathEntry);   }