SearchEnvelope { public HashSet<Resource> check(SpatialIndex spatialIndex) { HashSet<Resource> features = spatialIndex.query(mainEnvelope); if (wrapEnvelope != null) { HashSet<Resource> wrapFeatures = spatialIndex.query(wrapEnvelope); features.addAll(wrapFeatures); } return features; } protected  SearchEnvelope(Envelope envelope, SRSInfo srsInfo); Envelope getMainEnvelope(); Envelope getWrapEnvelope(); String getSrsURI(); SRSInfo getCrsInfo(); HashSet<Resource> check(SpatialIndex spatialIndex); boolean check(Envelope envelope); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static SearchEnvelope build(GeometryWrapper geometryWrapper, SRSInfo srsInfo, double radius, String unitsURI); static SearchEnvelope build(GeometryWrapper geometryWrapper, SRSInfo srsInfo); static SearchEnvelope build(GeometryWrapper geometryWrapper, SRSInfo srsInfo, CardinalDirection direction);  }
@Test public void testCheck() { SpatialIndex spatialIndex = SpatialIndexTestData.createTestIndex(); GeometryWrapper geometryWrapper = SpatialIndexTestData.PARIS_GEOMETRY_WRAPPER; float radius = 345; String unitsURI = Unit_URI.KILOMETER_URL; SearchEnvelope instance = SearchEnvelope.build(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO, radius, unitsURI); HashSet<Resource> expResult = new HashSet<>(Arrays.asList(SpatialIndexTestData.LONDON_FEATURE)); HashSet<Resource> result = instance.check(spatialIndex); assertEquals(expResult, result); }