### Question:
OSMAttachedSidewalkProcessor { public ReaderWay attachSidewalkTag(ReaderWay way, Side side) { switch(side) { case LEFT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); break; case RIGHT: way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); break; case BOTH: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE) && way.getTag(KEY_ORS_SIDEWALK_SIDE).equalsIgnoreCase(VAL_LEFT)) { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_RIGHT); } else { way.setTag(KEY_ORS_SIDEWALK_SIDE, VAL_LEFT); } break; case NONE: if(way.hasTag(KEY_ORS_SIDEWALK_SIDE)) { way.removeTag(KEY_ORS_SIDEWALK_SIDE); } } return way; }  ReaderWay attachSidewalkTag(ReaderWay way, Side side); Side getPreparedSide(ReaderWay way); static final String KEY_ORS_SIDEWALK_SIDE; static final String VAL_RIGHT; static final String VAL_LEFT; }### Answer:
@Test public void TestAttachingORSSidewalkSideTagForWayWithSingleSide() { ReaderWay way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.LEFT); assertTrue(way.hasTag("ors-sidewalk-side")); String side = way.getTag("ors-sidewalk-side"); assertEquals("left", side); way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.RIGHT); assertTrue(way.hasTag("ors-sidewalk-side")); side = way.getTag("ors-sidewalk-side"); assertEquals("right", side); }
@Test public void TestAttchingNoSidewalkRemovesAnyAlreadyAttachedORSSidewalkTags() { ReaderWay way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.NONE); assertFalse(way.hasTag("ors-sidewalk-side")); way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.LEFT); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.NONE); assertFalse(way.hasTag("ors-sidewalk-side")); }
@Test public void TestAttachingORSSidealkTagsWhenBothSidesHaveValues() { ReaderWay way = new ReaderWay(1); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.BOTH); assertTrue(way.hasTag("ors-sidewalk-side")); String side = way.getTag("ors-sidewalk-side"); assertEquals("left", side); way = processor.attachSidewalkTag(way, OSMAttachedSidewalkProcessor.Side.BOTH); assertTrue(way.hasTag("ors-sidewalk-side")); side = way.getTag("ors-sidewalk-side"); assertEquals("right", side); }