### Question:
OgcSfsCompliantPolygonCreator { public Polygon createPolygon(LinearRing shell, LinearRing[] holes) { if(holes == null) { return factory.createPolygon(shell, null); } ArrayList<LinearRing> holesList = new ArrayList<>(Arrays.asList(holes)); mergeHoles(holesList); return factory.createPolygon(shell, holesList.toArray(new LinearRing[]{})); } OgcSfsCompliantPolygonCreator(GeometryFactory factory); MultiPolygon createMultiPolygon(Polygon[] polygons); Polygon createPolygon(LinearRing shell, LinearRing[] holes);  }### Answer:
@Test public void createPolygonWithMergableHoles() { GeometryFactory factory = new GeometryFactory(new PrecisionModel()); OgcSfsCompliantPolygonCreator creator = new OgcSfsCompliantPolygonCreator(factory); Polygon p = creator.createPolygon( factory.createLinearRing(new Coordinate[]{p(0,0),p(4,0),p(4,4),p(0,4),p(0,0)}), new LinearRing[]{ factory.createLinearRing(new Coordinate[]{p(1,1),p(1,3),p(3,3),p(1,1)}), factory.createLinearRing(new Coordinate[]{p(1,1),p(3,3),p(3,1),p(1,1)}), } ); assertEquals(1,p.getNumInteriorRing()); LinearRing expect = factory.createLinearRing(new Coordinate[]{p(1,1),p(1,3),p(3,3),p(3,1),p(1,1)}); assertTrue(expect.isValid()); expect.normalize(); LineString actual = p.getInteriorRingN(0); actual.normalize(); assertEquals(expect,actual); }