@Test
public final void testLocationWithNullLines() {

    Location locNullLines = LocationFactory.createLineLocation(
            "locWithNullLines", Arrays.asList((Line) null, null));
    Location locOneNullLine = LocationFactory.createLineLocation(
            "locWithOnlyOneNullLine", Arrays.asList((Line) null));
    List<LocationReferenceHolder> encLocRef;
    try {
        OpenLREncoder encoder = new OpenLREncoder();
        OpenLREncoderParameter params = new OpenLREncoderParameter.Builder().with(td.getMapDatabase()).with(td.getConfiguration()).buildParameter();
        encLocRef = encoder.encodeLocations(params,
                Arrays.asList(locNullLines, locOneNullLine));
        for (LocationReferenceHolder lrh : encLocRef) {
            assertFalse(lrh.isValid());
            assertEquals(lrh.getReturnCode(),
                    EncoderReturnCode.LOCATION_NOT_CONNECTED);
        }
    } catch (OpenLRProcessingException e) {
        fail("Encoding location failed with exception: " + e.getErrorCode(),
                e);
    }
}