@Override
    public GeometryState createGroupedState()
    {
        return new GroupedGeometryState();
    }
@Test
    public void testMemoryAccounting()
    {
        GeometryState state = factory.createGroupedState();
        long oldSize = state.getEstimatedSize();
        OGCGeometry geometry = OGCGeometry.fromText("POLYGON ((2 2, 1 1, 3 1, 2 2))");

        long previousGeometryMemorySize = 0;
        state.setGeometry(geometry, previousGeometryMemorySize);
        assertTrue(oldSize < state.getEstimatedSize(), format("Expected old size %s to be less than new estimate %s", oldSize, state.getEstimatedSize()));

        oldSize = state.getEstimatedSize();
        previousGeometryMemorySize = state.getGeometry().estimateMemorySize();
        state.setGeometry(state.getGeometry().union(geometry), previousGeometryMemorySize);
        assertTrue(oldSize <= state.getEstimatedSize(), format("Expected old size %s to be less than or equal to new estimate %s", oldSize, state.getEstimatedSize()));
    }