@Test
public void testInvalidLocationReference() {

    Coordinates lastCoordinates = Coordinates.newBuilder()
            .setLongitude(4.2)
            .setLatitude(5.2)
            .build();
    LineAttributes lastLineAttributes = LineAttributes.newBuilder()
            .setBearing(270)
            .setFrc(FRC.FRC_1)
            .setFow(FOW.FOW_MULTIPLE_CARRIAGEWAY)
            .build();
    LocationReferencePoint last = LocationReferencePoint.newBuilder()
            .setCoordinates(lastCoordinates)
            .setLineAttributes(lastLineAttributes)
            .build();
    PointAlongLineLocationReference pointAlongLineLocationReference = PointAlongLineLocationReference.newBuilder()
            .setLast(last)
            .setPositiveOffset(20)
            .build();
    LocationReferenceData locationReferenceData = LocationReferenceData.newBuilder()
            .setPointAlongLineLocationReference(pointAlongLineLocationReference)
            .build();
    try {
        pointAlongLineDecoder.decode("1", locationReferenceData);
        fail();
    } catch (PhysicalFormatException e) {
        assertEquals(e.getErrorCode(), OpenLRProtoStatusCode.INVALID_LOCATION_REFERENCE);
    }
}