### Question:
FootFlagEncoder extends AbstractFlagEncoder { protected int handlePriority(ReaderWay way, int priorityFromRelation) { TreeMap<Double, Integer> weightToPrioMap = new TreeMap<Double, Integer>(); if (priorityFromRelation == 0) 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 int defineWayBits(int index, int shift); @Override int defineRelationBits(int index, int shift); @Override int defineTurnBits(int index, int shift); @Override boolean isTurnRestricted(long flag); @Override double getTurnCost(long flag); @Override long getTurnFlags(boolean restricted, double costs); @Override long acceptWay(ReaderWay way); @Override long handleRelationTags(ReaderRelation relation, long oldRelationFlags); @Override long handleWayTags(ReaderWay way, long allowed, long relationFlags); @Override double getDouble(long flags, int key); @Override boolean supports(Class<?> feature); @Override String toString(); @Override double getSpeed(long flags);  }### Answer:
@Test public void testPriority() { ReaderWay way = new ReaderWay(1); way.setTag("highway", "cycleway"); assertEquals(PriorityCode.UNCHANGED.getValue(), footEncoder.handlePriority(way, 0)); way.setTag("highway", "primary"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, 0)); way.setTag("highway", "track"); way.setTag("bicycle", "official"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, 0)); way.setTag("highway", "track"); way.setTag("bicycle", "designated"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, 0)); way.setTag("highway", "cycleway"); way.setTag("bicycle", "designated"); way.setTag("foot", "designated"); assertEquals(PriorityCode.PREFER.getValue(), footEncoder.handlePriority(way, 0)); way.clearTags(); way.setTag("highway", "primary"); way.setTag("sidewalk", "yes"); assertEquals(PriorityCode.UNCHANGED.getValue(), footEncoder.handlePriority(way, 0)); way.clearTags(); way.setTag("highway", "cycleway"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.UNCHANGED.getValue(), footEncoder.handlePriority(way, 0)); way.clearTags(); way.setTag("highway", "road"); way.setTag("bicycle", "official"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, 0)); way.clearTags(); way.setTag("highway", "trunk"); way.setTag("sidewalk", "no"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, 0)); way.setTag("sidewalk", "none"); assertEquals(PriorityCode.AVOID_IF_POSSIBLE.getValue(), footEncoder.handlePriority(way, 0)); way.clearTags(); way.setTag("highway", "residential"); way.setTag("sidewalk", "yes"); assertEquals(PriorityCode.PREFER.getValue(), footEncoder.handlePriority(way, 0)); }