PointInCircle implements Predicate<Field<T>> { @Override public boolean resolve(final Field<T> field) { return field.equals( this.circle.radius(), new Norm<T>(new Minus<T>(this.point, this.circle.center())) ); } PointInCircle(final Vect<T> point, final Circle<T> circle); @Override boolean resolve(final Field<T> field);  }
@Test public void resolvesTrueWhenInCircle() { final RandomPoint<Double> point = new RandomPoint<>(); final Circle<Double> any = new PtsCircle<>(new RandomPoint<>(), point); final Decimal field = new Decimal(); MatcherAssert.assertThat( new PointInCircle<>(point, any).resolve(field), Matchers.is(true) ); MatcherAssert.assertThat( new PointInCircle<>( new InCirclePoint<>(any), any ).resolve(field), Matchers.is(true) ); }