@Test(expected = IllegalArgumentException.class) public final void calculateWithWrongInterval() { provider.calculate(x -> 0.0, 2.0, 1.0, portfolio); }
@Override public double calculate(Function<Double, Double> f, double a, double b, IntegralPortfolio spec) { if (b <= a || spec == null || f == null) { throw new IllegalArgumentException("Invalid input arguments"); } final DirectSummation ds = (DirectSummation) spec; System.out.println("Received: a=" + a + ", b=" + b + ", dx=" + ds.getDx()); return 1.0; }
DirectSummationProvider implements IntegralSPI { @Override public double calculate(Function<Double, Double> f, double a, double b, IntegralPortfolio spec) { if (b <= a || spec == null || f == null) { throw new IllegalArgumentException("Invalid input arguments"); } final DirectSummation ds = (DirectSummation) spec; System.out.println("Received: a=" + a + ", b=" + b + ", dx=" + ds.getDx()); return 1.0; } }
DirectSummationProvider implements IntegralSPI { @Override public double calculate(Function<Double, Double> f, double a, double b, IntegralPortfolio spec) { if (b <= a || spec == null || f == null) { throw new IllegalArgumentException("Invalid input arguments"); } final DirectSummation ds = (DirectSummation) spec; System.out.println("Received: a=" + a + ", b=" + b + ", dx=" + ds.getDx()); return 1.0; }  }
DirectSummationProvider implements IntegralSPI { @Override public double calculate(Function<Double, Double> f, double a, double b, IntegralPortfolio spec) { if (b <= a || spec == null || f == null) { throw new IllegalArgumentException("Invalid input arguments"); } final DirectSummation ds = (DirectSummation) spec; System.out.println("Received: a=" + a + ", b=" + b + ", dx=" + ds.getDx()); return 1.0; }  @Override double calculate(Function<Double, Double> f, double a, double b,
            IntegralPortfolio spec); @Override Class<? extends IntegralPortfolio> getPortfolioType(); }
DirectSummationProvider implements IntegralSPI { @Override public double calculate(Function<Double, Double> f, double a, double b, IntegralPortfolio spec) { if (b <= a || spec == null || f == null) { throw new IllegalArgumentException("Invalid input arguments"); } final DirectSummation ds = (DirectSummation) spec; System.out.println("Received: a=" + a + ", b=" + b + ", dx=" + ds.getDx()); return 1.0; }  @Override double calculate(Function<Double, Double> f, double a, double b,
            IntegralPortfolio spec); @Override Class<? extends IntegralPortfolio> getPortfolioType();  }