### Question:
GeometryStateFactory implements AccumulatorStateFactory<GeometryState> { @Override public GeometryState createGroupedState() { return new GroupedGeometryState(); }  @Override GeometryState createSingleState(); @Override Class<? extends GeometryState> getSingleStateClass(); @Override GeometryState createGroupedState(); @Override Class<? extends GeometryState> getGroupedStateClass();  }### Answer:
@Test public void testCreateGroupedStateEmpty() { GeometryState state = factory.createGroupedState(); assertNull(state.getGeometry()); assertTrue(state.getEstimatedSize() > 0, "Estimated memory size was " + state.getEstimatedSize()); }
@Test public void testCreateGroupedStatePresent() { GeometryState state = factory.createGroupedState(); assertNull(state.getGeometry()); assertTrue(state instanceof GeometryStateFactory.GroupedGeometryState); GeometryStateFactory.GroupedGeometryState groupedState = (GeometryStateFactory.GroupedGeometryState) state; groupedState.setGroupId(1); assertNull(state.getGeometry()); groupedState.setGeometry(OGCGeometry.fromText("POINT (1 2)")); assertEquals(state.getGeometry(), OGCGeometry.fromText("POINT (1 2)")); groupedState.setGroupId(2); assertNull(state.getGeometry()); groupedState.setGeometry(OGCGeometry.fromText("POINT (3 4)")); assertEquals(state.getGeometry(), OGCGeometry.fromText("POINT (3 4)")); groupedState.setGroupId(1); assertNotNull(state.getGeometry()); }