### Question:
WheelchairFlagEncoder extends FootFlagEncoder { @Override protected int handlePriority(ReaderWay way, Integer priorityFromRelation) { TreeMap<Double, Integer> weightToPrioMap = new TreeMap<>(); weightToPrioMap.put(100d, super.handlePriority(way, priorityFromRelation)); if (way.hasTag("wheelchair", "designated")) { weightToPrioMap.put(102d, VERY_NICE.getValue()); } else if (way.hasTag("wheelchair", "limited")) { weightToPrioMap.put(102d, REACH_DEST.getValue()); } return weightToPrioMap.lastEntry().getValue(); } WheelchairFlagEncoder();  WheelchairFlagEncoder(PMap properties);  WheelchairFlagEncoder(int speedBits, double speedFactor); @Override int getVersion(); @Override EncodingManager.Access getAccess(ReaderWay way); @Override IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access); @Override void applyWayTags(ReaderWay way, EdgeIteratorState edge); @Override String toString();  }### Answer:
@Test public void testPriority() { ReaderWay way = new ReaderWay(1); way.setTag("highway", "cycleway"); assertEquals(PriorityCode.UNCHANGED.getValue(), wheelchairEncoder.handlePriority(way, null)); way.setTag("highway", "primary"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), wheelchairEncoder.handlePriority(way, null)); way.setTag("highway", "track"); way.setTag("bicycle", "official"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), wheelchairEncoder.handlePriority(way, null)); way.setTag("highway", "track"); way.setTag("bicycle", "designated"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), wheelchairEncoder.handlePriority(way, null)); way.setTag("highway", "cycleway"); way.setTag("bicycle", "designated"); way.setTag("foot", "designated"); assertEquals(PriorityCode.PREFER.getValue(), wheelchairEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "primary"); way.setTag("sidewalk", "yes"); assertEquals(PriorityCode.UNCHANGED.getValue(), wheelchairEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "cycleway"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.UNCHANGED.getValue(), wheelchairEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "road"); way.setTag("bicycle", "official"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), wheelchairEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "trunk"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), wheelchairEncoder.handlePriority(way, null)); way.setTag("sidewalk", "none"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), wheelchairEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "residential"); way.setTag("sidewalk", "yes"); assertEquals(PriorityCode.PREFER.getValue(), wheelchairEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "footway"); assertEquals(PriorityCode.PREFER.getValue(), wheelchairEncoder.handlePriority(way, null)); way.setTag("wheelchair", "designated"); assertEquals(PriorityCode.VERY_NICE.getValue(), wheelchairEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "footway"); assertEquals(PriorityCode.PREFER.getValue(), wheelchairEncoder.handlePriority(way, null)); way.setTag("wheelchair", "limited"); assertEquals(PriorityCode.REACH_DEST.getValue(), wheelchairEncoder.handlePriority(way, null)); }