Intersecting implements Predicate<Field<T>> { @Override public boolean resolve(final Field<T> field) { return !new Parallel<>(this.first, this.second).resolve(field); } Intersecting(final Line<T> first, final Line<T> second); @Override boolean resolve(final Field<T> field);  }
@Test public void resolvesTrueWhenDifferentDirs() { final Line<Double> any = new RandomLine<>(); MatcherAssert.assertThat( new Intersecting<>( any, new PtDirLine<>( new RandomPoint<>(), new DifferentPoint<>(any.direction()) ) ).resolve(new Decimal()), Matchers.is(true) ); }
@Test public void resolvesFalseWhenSameDirs() { final Line<Double> any = new RandomLine<>(); MatcherAssert.assertThat( new Intersecting<>( any, new PtDirLine<>(new RandomPoint<>(), any.direction()) ).resolve(new Decimal()), Matchers.is(false) ); }