### Question:
DirectionApiLogic { public TravelMode getTravelMode(String mode) { switch (mode.toLowerCase()) { case "driving": case "car": return TravelMode.DRIVING; case "bicycling": case "bicycle": case "bike": return TravelMode.BICYCLING; case "transit": case "public transport": case "public transit": case "transport": return TravelMode.TRANSIT; case "walking": case "walk": return TravelMode.WALKING; default: return null; } }  BestTransportResult fromTo(String origin, String destination, TravelMode mode); BestTransportResult fromToWithDeparture(String origin, String destination, TravelMode mode,
			ReadableInstant departureTime); ReadableInstant whenIHaveToGo(String origin, String destination, TravelMode mode, DateTime arrivalTime); BestTransportResult getBestTransportInTime(String origin, String destination,
			ReadableInstant departureTime); TravelMode getTravelMode(String mode);  }### Answer:
@Test public void testGetTravelModeDriving() { assertThat(this.logic.getTravelMode("driving"), equalTo(TravelMode.DRIVING)); assertThat(this.logic.getTravelMode("car"), equalTo(TravelMode.DRIVING)); }
@Test public void testGetTravelModeBicycling() { assertThat(this.logic.getTravelMode("bicycling"), equalTo(TravelMode.BICYCLING)); assertThat(this.logic.getTravelMode("bike"), equalTo(TravelMode.BICYCLING)); }
@Test public void testGetTravelModeTransit() { assertThat(this.logic.getTravelMode("transit"), equalTo(TravelMode.TRANSIT)); assertThat(this.logic.getTravelMode("public transport"), equalTo(TravelMode.TRANSIT)); assertThat(this.logic.getTravelMode("transport"), equalTo(TravelMode.TRANSIT)); }
@Test public void testGetTravelModeWalking() { assertThat(this.logic.getTravelMode("walking"), equalTo(TravelMode.WALKING)); assertThat(this.logic.getTravelMode("walk"), equalTo(TravelMode.WALKING)); }
@Test public void testGetTravelModeWrongMode() { assertThat(this.logic.getTravelMode("tfgzutzvj"), equalTo(null)); }