AndroidBuildProcessParametersProvider extends BuildProcessParametersProvider { @VisibleForTesting List<String> getJarsContainingClasses(Class<?>... classes) { List<String> foundItems = new ArrayList<>(classes.length); List<Class<?>> missingItems = new ArrayList<>(classes.length); for (Class<?> aClass : classes) { String path = PathManager.getJarPathForClass(aClass); if (path != null) { foundItems.add(path); } else { missingItems.add(aClass); } } reportMissingClasses(missingItems); return foundItems; }  @NotNull @Override List<String> getClassPath();  }
@Test public void getJarsContainingClassesDoesNotThrowNPE() { assume().that(PathManager.getJarPathForClass(CLASS_FROM_JRE)).isNull(); List<String> jars = inst.getJarsContainingClasses(CLASS_FROM_JRE); assertThat(jars).isEmpty(); }
@Test public void classesWithNoJarAreReported() { assume().that(PathManager.getJarPathForClass(CLASS_FROM_JRE)).isNull(); inst.getJarsContainingClasses(CLASS_FROM_JRE); assertThat(reportedMissingItems.get()).containsExactly(CLASS_FROM_JRE); }