### Question:
CarFlagEncoder extends AbstractFlagEncoder { @Override public long handleWayTags(ReaderWay way, long allowed, long relationFlags) { if (!isAccept(allowed)) return 0; long flags = 0; if (!isFerry(allowed)) { double speed = getSpeed(way); speed = applyMaxSpeed(way, speed); speed = applyBadSurfaceSpeed(way, speed); flags = setSpeed(flags, speed); boolean isRoundabout = way.hasTag("junction", "roundabout") || way.hasTag("junction", "circular"); if (isRoundabout) flags = setBool(flags, K_ROUNDABOUT, true); if (isOneway(way) || isRoundabout) { if (isBackwardOneway(way)) flags |= backwardBit; if (isForwardOneway(way)) flags |= forwardBit; } else flags |= directionBitMask; } else { double ferrySpeed = getFerrySpeed(way); flags = setSpeed(flags, ferrySpeed); flags |= directionBitMask; } for (String restriction : restrictions) { if (way.hasTag(restriction, "destination")) { flags = setSpeed(flags, destinationSpeed); } } return flags; } 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 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)); ReaderWay way = new ReaderWay(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)); way.clearTags(); way.setTag("highway", "motorway"); way.setTag("junction", "circular"); flags = encoder.handleWayTags(way, encoder.acceptBit, 0); assertTrue(encoder.isForward(flags)); assertFalse(encoder.isBackward(flags)); assertTrue(encoder.isBool(flags, FlagEncoder.K_ROUNDABOUT)); }