### Question:
CarFlagEncoder extends AbstractFlagEncoder { protected double applyBadSurfaceSpeed(ReaderWay way, double speed) { if (badSurfaceSpeed > 0 && speed > badSurfaceSpeed && way.hasTag("surface", badSurfaceSpeedMap)) speed = badSurfaceSpeed; return speed; } CarFlagEncoder();  CarFlagEncoder(PMap properties);  CarFlagEncoder(String propertiesStr);  CarFlagEncoder(int speedBits, double speedFactor, int maxTurnCosts); @Override int getVersion(); @Override void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index); @Override EncodingManager.Access getAccess(ReaderWay way); @Override IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay way, EncodingManager.Access accept); @Override String toString();  }### Answer:
@Test public void testApplyBadSurfaceSpeed() { ReaderWay way = new ReaderWay(1); way.setTag("highway", "secondary"); way.setTag("surface", "unpaved"); assertEquals(30, encoder.applyBadSurfaceSpeed(way, 90), 1e-1); }