If you want to actually use the integrator object, you need to call the integrate method, which takes an instance of UnivariateFunction. If you are on Java 8, this is a single-method interface, so it is automatically a functional interface. Thus, you can pass a lambda or a method reference, as in:
final SimpsonIntegrator si = new SimpsonIntegrator();
final double result = si.integrate(50, x -> 2*x, 0, 10);
System.out.println(result + " should be 100");
Otherwise, you have to create an implementation of the interface yourself, either by having a class implement it, or by using an anonymous class:
final double result = si.integrate(50, new UnivariateFunction() {
@Override public double value(double x) {
return 2*x;
}
}, 0, 10);
System.out.println(result + " should be 100");