GeometryOperatorList implements GeometryOperator { @Override public Geometry apply(Geometry t, Context context) { if (t == null) { return null; } Geometry tmp = t; for (BiFunction<Geometry, Context, Geometry> function : operatorList) { tmp = function.apply(tmp, context); } return tmp; } GeometryOperatorList(List<GeometryOperator> operatorList); @Override Geometry apply(Geometry t, Context context); @Override String toString();  }
@Test public void testApplyNullArg() { assertThat(geometryOperatorList.apply(null, new GeometryOperator.Context()), nullValue()); }
@Test public void testApply() { Geometry geometry = mock(Geometry.class); Geometry newGeometry = mock(Geometry.class); GeometryOperator.Context context = new GeometryOperator.Context(); when(childGeometryFunction.apply(geometry, context)).thenReturn(newGeometry); Geometry result = geometryOperatorList.apply(geometry, context); assertThat(result, is(newGeometry)); }