### Question:
Sequence extends Structure implements Iterable<ucar.array.StructureData> { public Builder<?> toBuilder() { return addLocalFieldsToBuilder(builder()); } protected  Sequence(Builder<?> builder, Group parentGroup); @Deprecated StructureDataIterator getStructureIterator(int bufferSize); @Override Iterator<ucar.array.StructureData> iterator(); @Override Array read(ucar.ma2.Section section); @Override Array read(int[] origin, int[] shape); @Override Array read(String sectionSpec); @Override Array read(List<Range> ranges); @Override StructureData readStructure(int index); @Override ArrayStructure readStructure(int start, int count); @Override Variable slice(int dim, int value); @Override Variable section(Section subsection); Builder<?> toBuilder(); static Builder<?> builder();  }### Answer:
@Test public void testToBuilder() throws IOException { Sequence.Builder<?> structb = Sequence.builder().setName("seq").addMemberVariable("one", DataType.BYTE, "") .addMemberVariable("two", DataType.STRING, "").addMemberVariable("tres", DataType.FLOAT, ""); StructureData sdata = makeStructureData(1); ArrayStructureW cacheData = new ArrayStructureW(sdata.getStructureMembers(), new int[] {2, 2}); for (int i = 0; i < 4; i++) { cacheData.setStructureData(makeStructureData(i + 1), i); } structb.setSourceData(cacheData); Structure struct1 = structb.build(makeDummyGroup()); Structure struct2 = struct1.toBuilder().setName("struct2").build(makeDummyGroup()); Array data = struct2.read(); assertThat(data).isNotNull(); assertThat(data).isInstanceOf(ArrayStructure.class); ArrayStructure as = (ArrayStructure) data; try (StructureDataIterator iter = as.getStructureDataIterator()) { int count = 0; while (iter.hasNext()) { StructureData sd = iter.next(); assertThat(compare(sd, makeStructureData(count + 1))).isTrue(); count++; } assertThat(count).isEqualTo(4); } }