### Question:
DataFactories { public static Header.Factory defaultFormatRelationshipFileHeader( Supplier<ZoneId> defaultTimeZone ) { return new DefaultRelationshipFileHeaderParser( defaultTimeZone ); } private  DataFactories(); static DataFactory data( final Decorator decorator,
            final Charset charset, final File... files ); static DataFactory data( final Decorator decorator,
            final Supplier<CharReadable> readable ); static Header.Factory defaultFormatNodeFileHeader( Supplier<ZoneId> defaultTimeZone ); static Header.Factory defaultFormatNodeFileHeader(); static Header.Factory defaultFormatRelationshipFileHeader( Supplier<ZoneId> defaultTimeZone ); static Header.Factory defaultFormatRelationshipFileHeader(); @SafeVarargs static Iterable<DataFactory> datas( DataFactory... factories ); static Pair<String,String> splitTypeSpecAndOptionalParameter( String typeSpec );  }### Answer:
@Test public void shouldParseDefaultRelationshipFileHeaderCorrectly() throws Exception { CharSeeker seeker = seeker( ":START_ID\t:END_ID\ttype:TYPE\tdate:long\tmore:long[]" ); IdType idType = IdType.ACTUAL; Extractors extractors = new Extractors( '\t' ); Header header = DataFactories.defaultFormatRelationshipFileHeader().create( seeker, TABS, idType, groups ); assertArrayEquals( array( entry( null, Type.START_ID, idType.extractor( extractors ) ), entry( null, Type.END_ID, idType.extractor( extractors ) ), entry( "type", Type.TYPE, extractors.string() ), entry( "date", Type.PROPERTY, extractors.long_() ), entry( "more", Type.PROPERTY, extractors.longArray() ) ), header.entries() ); seeker.close(); }
@Test public void shouldParseGroupName() throws Exception { String groupOneName = "GroupOne"; String groupTwoName = "GroupTwo"; CharSeeker seeker = seeker( ":START_ID(" + groupOneName + ")\t:END_ID(" + groupTwoName + ")\ttype:TYPE\tdate:long\tmore:long[]" ); IdType idType = IdType.ACTUAL; Extractors extractors = new Extractors( '\t' ); groups.getOrCreate( groupOneName ); groups.getOrCreate( groupTwoName ); Header header = DataFactories.defaultFormatRelationshipFileHeader().create( seeker, TABS, idType, groups ); assertArrayEquals( array( entry( null, Type.START_ID, "GroupOne", idType.extractor( extractors ) ), entry( null, Type.END_ID, "GroupTwo", idType.extractor( extractors ) ), entry( "type", Type.TYPE, extractors.string() ), entry( "date", Type.PROPERTY, extractors.long_() ), entry( "more", Type.PROPERTY, extractors.longArray() ) ), header.entries() ); seeker.close(); }
@Test public void shouldFailOnUnexpectedRelationshipHeaderType() { CharSeeker seeker = seeker( ":LABEL,:START_ID,:END_ID,:TYPE" ); IdType idType = IdType.ACTUAL; try { Header header = DataFactories.defaultFormatRelationshipFileHeader().create( seeker, COMMAS, idType, groups ); fail( "Should have failed" ); } catch ( InputException e ) { assertThat( e.getMessage(), containsString( "LABEL" ) ); } }