### Question:
CarFlagEncoder extends AbstractFlagEncoder { protected double getSpeed(ReaderWay way) { String highwayValue = way.getTag("highway"); if (!Helper.isEmpty(highwayValue) && way.hasTag("motorroad", "yes") && highwayValue != "motorway" && highwayValue != "motorway_link") { highwayValue = "motorroad"; } 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(ReaderWay way); @Override long handleRelationTags(ReaderRelation relation, long oldRelationFlags); @Override long handleWayTags(ReaderWay way, long allowed, long relationFlags); String getWayInfo(ReaderWay 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)); }