### Question:
CountryAreas { boolean covers(Point point) { int insides = 0; for (Point[] area : outer) { if(isPointInPolygon(point, area)) insides++; } for (Point[] area : inner) { if(isPointInPolygon(point, area)) insides--; } return insides > 0; } CountryAreas(String id, Point[][] outer, Point[][] inner); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void coversSimplePolygon() { assertTrue(new CountryAreas("A", new Point[][]{BIG_SQUARE}, new Point[][]{}).covers(p(5,5)) ); }
@Test public void doesNotCoverHole() { assertFalse(new CountryAreas("A", new Point[][]{BIG_SQUARE}, new Point[][]{HOLE}).covers(p(5,5)) ); }
@Test public void doesCoverPolygonInHole() { assertTrue(new CountryAreas("A", new Point[][]{BIG_SQUARE , SMALL_SQUARE}, new Point[][]{HOLE}).covers(p(5,5)) ); }
@Test public void onlyUpperLeftEdgeCountsAsInside() { CountryAreas areas = new CountryAreas("A", new Point[][]{BIG_SQUARE}, new Point[][]{}); assertTrue(areas.covers(p(0,0))); assertTrue(areas.covers(p(5,0))); assertTrue(areas.covers(p(0,5))); assertFalse(areas.covers(p(5,10))); assertFalse(areas.covers(p(10,5))); assertFalse(areas.covers(p(10,10))); }