### Question:
MotorcycleFlagEncoder extends CarFlagEncoder { @Override public long handleWayTags( OSMWay way, long allowed, long priorityFromRelation ) { if (!isAccept(allowed)) return 0; long encoded = 0; if (!isFerry(allowed)) { double speed = getSpeed(way); speed = applyMaxSpeed(way, speed, true); double maxMCSpeed = parseSpeed(way.getTag("maxspeed:motorcycle")); if (maxMCSpeed > 0 && maxMCSpeed < speed) speed = maxMCSpeed * 0.9; if (speed > 30 && way.hasTag("surface", badSurfaceSpeedMap)) speed = 30; boolean isRoundabout = way.hasTag("junction", "roundabout"); if (isRoundabout) encoded = setBool(0, K_ROUNDABOUT, true); if (way.hasTag("oneway", oneways) || isRoundabout) { if (way.hasTag("oneway", "-1")) { encoded = setReverseSpeed(encoded, speed); encoded |= backwardBit; } else { encoded = setSpeed(encoded, speed); encoded |= forwardBit; } } else { encoded = setSpeed(encoded, speed); encoded = setReverseSpeed(encoded, speed); encoded |= directionBitMask; } } else { encoded = handleFerryTags(way, defaultSpeedMap.get("living_street"), defaultSpeedMap.get("service"), defaultSpeedMap.get("residential")); encoded |= directionBitMask; } encoded = priorityWayEncoder.setValue(encoded, handlePriority(way, priorityFromRelation)); return encoded; } MotorcycleFlagEncoder( PMap properties );  MotorcycleFlagEncoder( String propertiesStr );  MotorcycleFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts ); @Override int getVersion(); @Override int defineWayBits( int index, int shift ); @Override long acceptWay( OSMWay way ); @Override long handleWayTags( OSMWay way, long allowed, long priorityFromRelation ); @Override double getReverseSpeed( long flags ); @Override long setReverseSpeed( long flags, double speed ); @Override long flagsDefault( boolean forward, boolean backward ); @Override long setProperties( double speed, boolean forward, boolean backward ); @Override long reverseFlags( long flags ); @Override double getDouble( long flags, int key ); @Override boolean supports( Class<?> feature ); @Override String toString();  }### Answer:
@Test public void testHandleWayTags() { OSMWay way = new OSMWay(1); way.setTag("highway", "service"); long flags = encoder.acceptWay(way); assertTrue(flags > 0); long result = encoder.handleWayTags(way, flags, 0); assertEquals(20, encoder.getSpeed(result), .1); assertEquals(20, encoder.getReverseSpeed(result), .1); }