@Test
public void type7NistTest() throws Exception {

    Ebts ebts = new Ebts();
    GenericRecord type1 = new GenericRecord(1);
    type1.setField(3, new Field("0400"));
    type1.setField(8, new Field("WVMEDS001"));
    GenericRecord type2 = new GenericRecord(2);
    type2.setField(2, new Field("04"));
    type2.setField(19, new Field("Smith,John"));
    type2.getField(19).getOccurrences().add(new Occurrence("Smith,Johnny"));
    type2.setField(18, new Field("Smith,Jo"));
    type2.setField(41, new Field("B"));
    type2.setField(40, new Field("A"));
    List<String> strings = new ArrayList<String>();
    strings.add("Test1");
    strings.add("Test2");
    strings.add("Test3");
    List<Occurrence> occs = EbtsUtils.convertStringList(strings);
    occs.add(new Occurrence("HI"));
    occs.remove(new Occurrence("HI"));
    type2.setField(50,new Field(occs));
    int[] header = new int[] {4,1};
    BinaryHeaderImageRecord type7 = new BinaryHeaderImageRecord(7,header);
    type7.setImageData(new byte[]{});
    ebts.addRecord(type1);
    ebts.addRecord(type2);
    ebts.addRecord(type7);
    EbtsBuilder ebtsBuilder = new EbtsBuilder();
    byte[] binaryData = ebtsBuilder.build(ebts);
    Ebts parsedEbts = EbtsParser.parse(binaryData,Type7Handling.NIST);
    log.info("{}",parsedEbts);
}