### Question:
PluginSettings extends Settings { public void addClasses(Set<Class<?>> classes) { List<Plugin> plugins = getPlugins(); List<Class<?>> otherClasses = getOtherClasses(); for (Class<?> c : classes) { if (Plugin.class.isAssignableFrom(c)) { plugins.add((Plugin) Reflections.newInstance(c)); } else { otherClasses.add(c); } } for (Plugin plugin : plugins) { for (Class<?> otherClass : otherClasses) { try { call.get(plugin).get(otherClass); } catch (ExecutionError error) { if (ExceptionUtils.getRootCause(error) instanceof ClassNotFoundException) { try { Files.deleteIfExists(getCachePath().resolve("deps")); } catch (IOException e) { } } throw error; } catch (ExecutionException error) { throw new GyroException( String.format( "Can't load @|bold %s|@ using the @|bold %s|@ plugin!", otherClass.getName(), plugin.getClass().getName()), error.getCause()); } } } }  List<Plugin> getPlugins(); void setPlugins(List<Plugin> plugins); List<Class<?>> getOtherClasses(); void setOtherClasses(List<Class<?>> otherClasses); void addClasses(Set<Class<?>> classes); Path getCachePath(); void setCachePath(Path cachePath); PluginClassLoader getPluginClassLoader(); DependencyResult getDependencyResult(String ac); void putDependencyResult(String ac, DependencyResult result); boolean pluginInitialized(String artifactCoord); void putArtifactIfNewer(Artifact artifact); void addAllUrls();  }### Answer:
@Test void addClasses() throws Exception { PluginSettings settings = new PluginSettings(); Class<?> testClass = getClass(); settings.addClasses(ImmutableSet.of(TestPlugin.class, testClass)); assertThat(settings.getPlugins()) .hasSize(1) .allSatisfy(plugin -> assertThat(plugin).isInstanceOf(TestPlugin.class)); assertThat(settings.getOtherClasses()).containsExactly(testClass); TestPlugin plugin = (TestPlugin) settings.getPlugins().get(0); assertThat(plugin.counts).hasSize(1); assertThat(plugin.counts.get(testClass)).isEqualTo(1); }
@Test void addClassesException() { PluginSettings settings = new PluginSettings(); assertThatExceptionOfType(Exception.class) .isThrownBy(() -> settings.addClasses(ImmutableSet.of(TestExceptionPlugin.class, getClass()))); }