### Question:
CarFlagEncoder extends AbstractFlagEncoder { protected double getSpeed( OSMWay way ) { String highwayValue = way.getTag("highway"); Integer speed = defaultSpeedMap.get(highwayValue); if (speed == null) throw new IllegalStateException(toString() + ", no speed found for: " + highwayValue + ", tags: " + way); if (highwayValue.equals("track")) { String tt = way.getTag("tracktype"); if (!Helper.isEmpty(tt)) { Integer tInt = trackTypeSpeedMap.get(tt); if (tInt != null) speed = tInt; } } return speed; } CarFlagEncoder();  CarFlagEncoder( PMap properties );  CarFlagEncoder( String propertiesStr );  CarFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts ); @Override int getVersion(); @Override int defineWayBits( int index, int shift ); @Override long acceptWay( OSMWay way ); @Override long handleRelationTags( OSMRelation relation, long oldRelationFlags ); @Override long handleWayTags( OSMWay way, long allowed, long relationFlags ); String getWayInfo( OSMWay way ); @Override String toString();  }### Answer:
@Test public void testSetSpeed() { assertEquals(10, encoder.getSpeed(encoder.setSpeed(0, 10)), 1e-1); }
@Test public void testSetSpeed0_issue367() { long flags = encoder.setProperties(10, true, true); flags = encoder.setSpeed(flags, encoder.speedFactor * 0.49); assertEquals(0, encoder.getSpeed(flags), .1); assertEquals(0, encoder.getReverseSpeed(flags), .1); assertFalse(encoder.isForward(flags)); assertFalse(encoder.isBackward(flags)); }