@Test void testEquals() { this.bestResult = new BestTransportResult(TravelMode.TRANSIT, this.data.transportRoutes[0]); assertTrue(this.bestResult.equals(new BestTransportResult(TravelMode.TRANSIT, this.data.transportRoutes[0]))); assertFalse(this.bestResult.equals(new BestTransportResult(TravelMode.BICYCLING, this.data.bicycleRoutes[0]))); assertFalse(this.bestResult.equals(new BestTransportResult())); }
@Override public boolean equals(Object obj) { if (obj instanceof BestTransportResult) { BestTransportResult best = (BestTransportResult) obj; return this.mode.equals(best.mode) && this.route.equals(best.route); } return false; }
BestTransportResult { @Override public boolean equals(Object obj) { if (obj instanceof BestTransportResult) { BestTransportResult best = (BestTransportResult) obj; return this.mode.equals(best.mode) && this.route.equals(best.route); } return false; } }
BestTransportResult { @Override public boolean equals(Object obj) { if (obj instanceof BestTransportResult) { BestTransportResult best = (BestTransportResult) obj; return this.mode.equals(best.mode) && this.route.equals(best.route); } return false; } BestTransportResult();  BestTransportResult(TravelMode mode, DirectionsRoute route); }
BestTransportResult { @Override public boolean equals(Object obj) { if (obj instanceof BestTransportResult) { BestTransportResult best = (BestTransportResult) obj; return this.mode.equals(best.mode) && this.route.equals(best.route); } return false; } BestTransportResult();  BestTransportResult(TravelMode mode, DirectionsRoute route); TravelMode getMode(); DirectionsRoute getRoute(); String routeToLongString(); String routeToShortString(); WidgetRouteInfo routeToWidgetInfo(String mapsStaticAPIKey); @Override boolean equals(Object obj); @Override int hashCode(); }
BestTransportResult { @Override public boolean equals(Object obj) { if (obj instanceof BestTransportResult) { BestTransportResult best = (BestTransportResult) obj; return this.mode.equals(best.mode) && this.route.equals(best.route); } return false; } BestTransportResult();  BestTransportResult(TravelMode mode, DirectionsRoute route); TravelMode getMode(); DirectionsRoute getRoute(); String routeToLongString(); String routeToShortString(); WidgetRouteInfo routeToWidgetInfo(String mapsStaticAPIKey); @Override boolean equals(Object obj); @Override int hashCode();  }