### Question:
FootFlagEncoder extends AbstractFlagEncoder { int handlePriority(ReaderWay way, Integer priorityFromRelation) { TreeMap<Double, Integer> weightToPrioMap = new TreeMap<>(); if (priorityFromRelation == null) weightToPrioMap.put(0d, UNCHANGED.getValue()); else weightToPrioMap.put(110d, priorityFromRelation); collect(way, weightToPrioMap); return weightToPrioMap.lastEntry().getValue(); } FootFlagEncoder();  FootFlagEncoder(PMap properties);  FootFlagEncoder(String propertiesStr);  FootFlagEncoder(int speedBits, double speedFactor); @Override int getVersion(); @Override void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index); @Override EncodingManager.Access getAccess(ReaderWay way); @Override IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access access); @Override boolean supports(Class<?> feature); @Override String toString();  }### Answer:
@Test public void testPriority() { ReaderWay way = new ReaderWay(1); way.setTag("highway", "cycleway"); assertEquals(PriorityCode.UNCHANGED.getValue(), footEncoder.handlePriority(way, null)); way.setTag("highway", "primary"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, null)); way.setTag("highway", "track"); way.setTag("bicycle", "official"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, null)); way.setTag("highway", "track"); way.setTag("bicycle", "designated"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, null)); way.setTag("highway", "cycleway"); way.setTag("bicycle", "designated"); way.setTag("foot", "designated"); assertEquals(PriorityCode.PREFER.getValue(), footEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "primary"); way.setTag("sidewalk", "yes"); assertEquals(PriorityCode.UNCHANGED.getValue(), footEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "cycleway"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.UNCHANGED.getValue(), footEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "road"); way.setTag("bicycle", "official"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "trunk"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, null)); way.setTag("sidewalk", "none"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, null)); way.clearTags(); way.setTag("highway", "residential"); way.setTag("sidewalk", "yes"); assertEquals(PriorityCode.PREFER.getValue(), footEncoder.handlePriority(way, null)); }