LoadScalable extends AbstractInjectionScalable { @Override public double maximumValue(Network n, ScalingConvention scalingConvention) { Objects.requireNonNull(n); Objects.requireNonNull(scalingConvention); Load l = n.getLoad(id); if (l != null) { return scalingConvention == LOAD ? maxValue : -minValue; } else { return 0; } } LoadScalable(String id);   LoadScalable(String id, double maxValue);   LoadScalable(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 testMaximumlValue() { assertEquals(Double.MAX_VALUE, l1.maximumValue(network, LOAD), 0.); assertEquals(-20, l3.maximumValue(network), 0.); assertEquals(-20, l3.maximumValue(network, GENERATOR), 0.); assertEquals(100, l3.maximumValue(network, LOAD), 0.); }