OpenLRXMLEncoder implements PhysicalEncoder { public final LocationReference encodeData( final RawLocationReference rawLocRef) { return encodeData(rawLocRef, VERSIONS[VERSIONS.length - 1]); }  final Class<?> getDataClass(); final String getDataFormatIdentifier(); final int[] getSupportedVersions(); final LocationReference encodeData(
            final RawLocationReference rawLocRef); final LocationReference encodeData(
            final RawLocationReference rawLocRef, final int version);  }
@Test public final void testWhitePaperLineLocation() { LocationReference ref = XML_ENCODER .encodeData(lineLocWhitePaperExample); XMLLocationReference xmlLoc = ((OpenLR) ref.getLocationReferenceData()) .getXMLLocationReference(); LineLocationReference lineLoc = xmlLoc.getLineLocationReference(); Utils.checkLRPs(lineLoc.getLocationReferencePoint(), lineLoc.getLastLocationReferencePoint(), pointsWPLineExample); Utils.checkOffsets(lineLoc.getOffsets(), offsetsWPLine); validEncodeLocation = ref; }
@Test public final void testMissingOffsets() { RawLineLocRef rawLoc = new RawLineLocRef("1", new ArrayList<LocationReferencePoint>(), null); LocationReference locRef = XML_ENCODER.encodeData(rawLoc); assertFalse(locRef.isValid()); }