VectsDegrees implements Degrees<T> { @Override public Number resolve(final InnerProduct<T> product) { return product.angle(this.first, this.second).resolve(product); } VectsDegrees(final Vect<T> first, final Vect<T> second); @Override Number resolve(final InnerProduct<T> product);  }
@Test public void delegatesToInnerProduct() { final Vect<Object> first = new FixedVector<>(new Random<>()); final Vect<Object> second = new FixedVector<>(new Random<>()); final MkProduct<Object> pdt = new MkProduct<>(); new VectsDegrees<>(first, second).resolve(pdt); final Optional<List<Vect<Object>>> params = pdt.angle(); MatcherAssert.assertThat( "Expecting call to angle method with vectors as parameters", params.isPresent() && params.get().get(0).equals(first) && params.get().get(1).equals(second) ); }