### Question:
TravelModeSet extends HashSet<TravelMode> { public TraverseModeSet toTraverseModeSet() { TraverseModeSet modeSet = new TraverseModeSet(); for (TravelMode travelMode : this) { TraverseMode traverseMode = (new TravelModeWrapper(travelMode)).toTraverseMode(); modeSet.setMode(traverseMode, true); } return modeSet; } TravelModeSet();  TravelModeSet(Collection<TravelMode> modes); TraverseModeSet toTraverseModeSet();  }### Answer:
@Test public void testAdd() { TravelModeSet modeSet = new TravelModeSet(); modeSet.add(TravelMode.WALK); modeSet.add(TravelMode.ANY_TRAIN); TraverseModeSet traverseModes = modeSet.toTraverseModeSet(); assertTrue(traverseModes.getWalk()); assertTrue(traverseModes.getTrainish()); assertFalse(traverseModes.getBicycle()); }
@Test public void testConstructFromSet() { Set<TravelMode> modes = new HashSet<TravelMode>(3); modes.add(TravelMode.WALK); modes.add(TravelMode.ANY_TRAIN); TravelModeSet modeSet = new TravelModeSet(modes); TraverseModeSet traverseModes = modeSet.toTraverseModeSet(); assertTrue(traverseModes.getWalk()); assertTrue(traverseModes.getTrainish()); assertFalse(traverseModes.getBicycle()); }