RouteServiceImpl implements RouteService { @Override public List<RouteModel> getActiveRoutes() { DcIdNameMapper mapper = new DcIdNameMapper.DefaultMapper(dcService); List<RouteModel> clone = Lists.transform(routeDao.getAllAvailableRoutes(), new Function<RouteTbl, RouteModel>() { @Override public RouteModel apply(RouteTbl input) { return RouteModel.fromRouteTbl(input, mapper); } }); return Lists.newArrayList(clone); }  @Override List<RouteTbl> getActiveRouteTbls(); @Override List<RouteModel> getAllRoutes(); @Override List<RouteModel> getActiveRoutes(); @Override void updateRoute(RouteModel model); @Override void deleteRoute(long id); @Override void addRoute(RouteModel model); @Override boolean existsRouteBetweenDc(String activeDc, String backupDc);  }
@Test public void testGetActiveRoutes() { List<RouteModel> routes = service.getActiveRoutes(); Collections.sort(routes, new Comparator<RouteModel>() { @Override public int compare(RouteModel o1, RouteModel o2) { return (int) (o1.getId() - o2.getId()); } }); Assert.assertEquals(Lists.newArrayList(route1), routes); }