### Question:
FootFlagEncoder extends AbstractFlagEncoder { protected int handlePriority( OSMWay 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( OSMWay way ); @Override long handleRelationTags( OSMRelation relation, long oldRelationFlags ); @Override long handleWayTags( OSMWay way, long allowed, long relationFlags ); @Override double getDouble( long flags, int key ); @Override boolean supports( Class<?> feature ); @Override String toString();  }### Answer:
@Test public void testPriority() { OSMWay way = new OSMWay(1); way.setTag("highway", "cycleway"); assertEquals(PriorityCode.UNCHANGED.getValue(), footEncoder.handlePriority(way, 0)); way.setTag("highway", "primary"); assertEquals(PriorityCode.REACH_DEST.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.REACH_DEST.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", "residential"); way.setTag("sidewalk", "yes"); assertEquals(PriorityCode.PREFER.getValue(), footEncoder.handlePriority(way, 0)); }