GeneratorScalable extends AbstractInjectionScalable { @Override public void filterInjections(Network n, List<Injection> injections, List<String> notFoundInjections) { Objects.requireNonNull(n); Objects.requireNonNull(injections); Generator generator = n.getGenerator(id); if (generator != null) { injections.add(generator); } else if (notFoundInjections != null) { notFoundInjections.add(id); } } GeneratorScalable(String id);   GeneratorScalable(String id, double minValue, double maxValue); @Override void reset(Network n); @Override double maximumValue(Network n, ScalingConvention scalingConvention); @Override double minimumValue(Network n, ScalingConvention scalingConvention); @Override void filterInjections(Network n, List<Injection> injections, List<String> notFoundInjections); @Override double scale(Network n, double asked, ScalingConvention scalingConvention);  }
@Test public void testFilterInjections() { Generator generator1 = network.getGenerator("g1"); List<Injection> generators = g1.filterInjections(network); assertEquals(1, generators.size()); assertSame(generator1, generators.get(0)); }