### Question:
SpatialRuleLookupJTS implements SpatialRuleLookup { @Override public SpatialRule getSpatialRule(int spatialId) { return rules.get(spatialId); } SpatialRuleLookupJTS(List<SpatialRule> spatialRules, Envelope maxBounds); @Override SpatialRule lookupRule(double lat, double lon); @Override SpatialRule lookupRule(GHPoint point); @Override int getSpatialId(SpatialRule rule); @Override SpatialRule getSpatialRule(int spatialId); @Override int size(); @Override Envelope getBounds();  }### Answer:
@Test public void testSpatialRuleForId() { List<SpatialRule> spatialRules = new ArrayList<>(); Polygon p1 = FAC.createPolygon(new Coordinate[] { new Coordinate(1, 1), new Coordinate(2, 1), new Coordinate(2, 1.5), new Coordinate(1, 1.5), new Coordinate(1, 1)}); Polygon p2 = FAC.createPolygon(new Coordinate[] { new Coordinate(1, 1.5), new Coordinate(2, 1.5), new Coordinate(2, 2), new Coordinate(1, 2), new Coordinate(1, 1.5)}); Polygon p3 = FAC.createPolygon(new Coordinate[] { new Coordinate(1, 1.5), new Coordinate(2, 1.5), new Coordinate(2, 2), new Coordinate(1, 2), new Coordinate(1, 1.5)}); Polygon p4 = FAC.createPolygon(new Coordinate[] { new Coordinate(1, 1.5), new Coordinate(2, 1.5), new Coordinate(2, 2), new Coordinate(1, 2), new Coordinate(1, 1.5)}); spatialRules.add(getSpatialRule(p1, "1")); spatialRules.add(getSpatialRule(p2, "2")); spatialRules.add(getSpatialRule(p3, "3")); spatialRules.add(getSpatialRule(p4, "4")); SpatialRuleLookup spatialRuleLookup = new SpatialRuleLookupJTS(spatialRules, new Envelope(1, 2, 1, 2)); assertEquals("1", spatialRuleLookup.getSpatialRule(1).getId()); assertEquals("4", spatialRuleLookup.getSpatialRule(4).getId()); }