Vertical implements Predicate<Field<T>> { @Override public boolean resolve(final Field<T> field) { return field.equals( this.line.direction().coords()[0], new AddIdentity<>() ); } Vertical(final Line<T> line);  Vertical(final Ray<T> ray);  Vertical(final Segment<T> seg); @Override boolean resolve(final Field<T> field);  }
@Test public void resolvesTrueWhenVertical() { MatcherAssert.assertThat( new Vertical<Double>( new VerticalLine<>() ).resolve(new Decimal()), Matchers.is(true) ); }
@Test public void resolvesFalseWhenNotVertical() { MatcherAssert.assertThat( new Vertical<Double>( new RandomLine<>() ).resolve(new Decimal()), Matchers.is(false) ); }