### Question:
TravelModeWrapper { public TraverseMode toTraverseMode() { switch (travelMode) { case BICYCLE: return TraverseMode.BICYCLE; case WALK: return TraverseMode.WALK; case CAR: return TraverseMode.CAR; case CUSTOM_MOTOR_VEHICLE: return TraverseMode.CUSTOM_MOTOR_VEHICLE; case TRAM: return TraverseMode.TRAM; case SUBWAY: return TraverseMode.SUBWAY; case RAIL: return TraverseMode.RAIL; case ANY_TRAIN: return TraverseMode.TRAINISH; case ANY_TRANSIT: return TraverseMode.TRANSIT; default: return null; } }  TraverseMode toTraverseMode();  }### Answer:
@Test public void testToTraverseMode() { Map<TravelMode, TraverseMode> modeMap = new HashMap<TravelMode, TraverseMode>(); modeMap.put(TravelMode.BICYCLE, TraverseMode.BICYCLE); modeMap.put(TravelMode.CAR, TraverseMode.CAR); modeMap.put(TravelMode.CUSTOM_MOTOR_VEHICLE, TraverseMode.CUSTOM_MOTOR_VEHICLE); modeMap.put(TravelMode.WALK, TraverseMode.WALK); modeMap.put(TravelMode.ANY_TRAIN, TraverseMode.TRAINISH); modeMap.put(TravelMode.ANY_TRANSIT, TraverseMode.TRANSIT); for (TravelMode travelMode : modeMap.keySet()) { TraverseMode expectedTraverseMode = modeMap.get(travelMode); TraverseMode actualTraverseMode = (new TravelModeWrapper(travelMode)).toTraverseMode(); assertEquals(expectedTraverseMode, actualTraverseMode); } }