Obtuse implements Degrees<T> { @Override public Number resolve(final InnerProduct<T> product) { return Math.PI / 2 + this.random * Math.PI / 2; } Obtuse(); @Override Number resolve(final InnerProduct<T> product);  }
@Test public void resolvesObtuseAngle() { final double angle = new Obtuse<>().resolve(new MkProduct<>()).doubleValue(); MatcherAssert.assertThat( angle, Matchers.greaterThanOrEqualTo(Math.PI / 2) ); MatcherAssert.assertThat(angle, Matchers.lessThanOrEqualTo(Math.PI)); }
@Test public void toStringPrintsAngle() { final Obtuse<Double> obtuse = new Obtuse<>(); final Double angle = obtuse.resolve(new MkProduct<>()).doubleValue(); final int precision = 6; MatcherAssert.assertThat( obtuse.toString(), Matchers.containsString( Double.toString(angle * 2 / Math.PI - 1).substring(0, precision) ) ); }