### Question:
CarFlagEncoder extends AbstractFlagEncoder { @Override public long handleWayTags( OSMWay way, long allowed, long relationFlags ) { if (!isAccept(allowed)) return 0; long encoded; if (!isFerry(allowed)) { double speed = getSpeed(way); speed = applyMaxSpeed(way, speed, true); if (speed > 30 && way.hasTag("surface", badSurfaceSpeedMap)) speed = 30; encoded = setSpeed(0, speed); boolean isRoundabout = way.hasTag("junction", "roundabout"); if (isRoundabout) encoded = setBool(encoded, K_ROUNDABOUT, true); boolean isOneway = way.hasTag("oneway", oneways) || way.hasTag("vehicle:backward") || way.hasTag("vehicle:forward") || way.hasTag("motor_vehicle:backward") || way.hasTag("motor_vehicle:forward"); if (isOneway || isRoundabout) { boolean isBackward = way.hasTag("oneway", "-1") || way.hasTag("vehicle:forward", "no") || way.hasTag("motor_vehicle:forward", "no"); if (isBackward) encoded |= backwardBit; else encoded |= forwardBit; } else encoded |= directionBitMask; } else { encoded = handleFerryTags(way, defaultSpeedMap.get("living_street"), defaultSpeedMap.get("service"), defaultSpeedMap.get("residential")); encoded |= directionBitMask; } return encoded; } 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 testRoundabout() { long flags = encoder.setAccess(0, true, true); long resFlags = encoder.setBool(flags, FlagEncoder.K_ROUNDABOUT, true); assertTrue(encoder.isBool(resFlags, FlagEncoder.K_ROUNDABOUT)); assertTrue(encoder.isForward(resFlags)); assertTrue(encoder.isBackward(resFlags)); resFlags = encoder.setBool(flags, FlagEncoder.K_ROUNDABOUT, false); assertFalse(encoder.isBool(resFlags, FlagEncoder.K_ROUNDABOUT)); assertTrue(encoder.isForward(resFlags)); assertTrue(encoder.isBackward(resFlags)); OSMWay way = new OSMWay(1); way.setTag("highway", "motorway"); flags = encoder.handleWayTags(way, encoder.acceptBit, 0); assertTrue(encoder.isForward(flags)); assertTrue(encoder.isBackward(flags)); assertFalse(encoder.isBool(flags, FlagEncoder.K_ROUNDABOUT)); way.setTag("junction", "roundabout"); flags = encoder.handleWayTags(way, encoder.acceptBit, 0); assertTrue(encoder.isForward(flags)); assertFalse(encoder.isBackward(flags)); assertTrue(encoder.isBool(flags, FlagEncoder.K_ROUNDABOUT)); }