### Question:
AbstractLayeredBoard implements ClientBoard { protected boolean isNear(int numLayer, int x, int y, E element) { if (pt(x, y).isOutOf(size)) { return false; } return countNear(numLayer, x, y, element) > 0; }  ClientBoard forString(String boardString); ClientBoard forString(String... layers); abstract E valueOf(char ch); int size(); static Set<Point> removeDuplicates(Collection<Point> all); @Override String toString(); boolean isOutOfField(int x, int y); List<String> getLayersString(); void setSource(JSONObject source);  }### Answer:
@Test public void shouldWork_isNear_layer1() { assertEquals(true, board.isNear(LAYER_1, 1, 1, Elements.ONE)); assertEquals(false, board.isNear(LAYER_1, 5, 5, Elements.TWO)); }
@Test public void shouldWork_isNear_layer2() { assertEquals(true, board.isNear(LAYER_2, 1, 1, Elements.NONE)); assertEquals(false, board.isNear(LAYER_2, 0, 3, Elements.FOUR)); }