@Test
public final void testRouteSearch() {

    TestData td = TestData.getInstance();
    Location loc = td.getRoute();
    List<? extends Line> theRoute = loc.getLocationLines();
    RouteSearchResult result = null;
    try {
        RouteSearch rs = new RouteSearch(theRoute);
        result = rs.calculateRoute();
    } catch (OpenLREncoderProcessingException e1) {
        fail("Unexpected exception", e1);
    }
    assertTrue("Route search failed for first calculation!", result
            .getResult() == RouteSearchResult.RouteSearchReturnCode.INTERMEDIATE_FOUND);
    assertEquals("Wrong intermediate found!", result.getIntermediate()
            .getID(), td.getIntermediate().getID());
    assertEquals("Wrong route length 1!", result.getRouteLength(), td
            .getRoutLength1());
    List<? extends Line> rest = theRoute.subList(td.getIntermediatePos(),
            theRoute.size());
    try {
        RouteSearch rs = new RouteSearch(rest);
        result = rs.calculateRoute();
        CommonObjectTestUtils.testToString(rs);
    } catch (OpenLREncoderProcessingException e) {
        fail("Unexpected exception", e);
    }
    assertTrue("Route search failed for first calculation!", result
            .getResult() == RouteSearchResult.RouteSearchReturnCode.ROUTE_FOUND);
    assertEquals("Wrong route length 2!", result.getRouteLength(), td
            .getRoutLength2());
    //TODO calculate invalid route
}