ModeSRS { public void search(Model model) { ExtendedIterator<RDFNode> nodeIter = model.listObjectsOfProperty(Geo.HAS_SERIALIZATION_PROP); boolean isGeometryLiteralsFound = nodeIter.hasNext(); if (!isGeometryLiteralsFound) { NodeIterator wktNodeIter = model.listObjectsOfProperty(Geo.AS_WKT_PROP); NodeIterator gmlNodeIter = model.listObjectsOfProperty(Geo.AS_GML_PROP); nodeIter = wktNodeIter.andThen(gmlNodeIter); } while (nodeIter.hasNext()) { RDFNode node = nodeIter.next(); if (node.isLiteral()) { GeometryWrapper geometryWrapper = GeometryWrapper.extract(node.asLiteral()); String srsURI = geometryWrapper.getSrsURI(); Integer count; if (srsMap.containsKey(srsURI)) { count = srsMap.get(srsURI); count++; } else { count = 1; } srsMap.put(srsURI, count); } } if (!isGeometryLiteralsFound) { List<RDFNode> geoList = model.listObjectsOfProperty(SpatialExtension.GEO_LAT_PROP).toList(); if (!geoList.isEmpty()) { srsMap.put(SRS_URI.WGS84_CRS, geoList.size()); } } srsList = srsMap.entrySet().stream().sorted(Collections.reverseOrder(Map.Entry.comparingByValue())).collect(Collectors.toList()); } ModeSRS(); void search(Model model); List<Entry<String, Integer>> getSrsList(); HashMap<String, Integer> getSrsMap(); String getModeURI(); @Override String toString();  }
@Test public void testSearch() { ModeSRS instance = new ModeSRS(); instance.search(MODEL); List<Entry<String, Integer>> expResult = new ArrayList<>(); expResult.add(new SimpleEntry<>("http: expResult.add(new SimpleEntry<>("http: expResult.add(new SimpleEntry<>("http: List<Entry<String, Integer>> result = instance.getSrsList(); assertEquals(expResult, result); }