### Question:
SequenceBuilder { public FromIterator fromIterator(Iterator<T> iterator) { return new FromIterator(iterator, 0, initialState, transitionMapping); }  static VertexLabel proxyLabelFor(VertexLabel label); SequenceBuilder<T> withInitialState(Vertex<?, ?> vertex); SequenceBuilder<T> named(String sequenceName); SequenceBuilder<T> withInitialState(VertexLabel label, Vertex<?, ?> vertex); SequenceBuilder<T> withInitialState(VertexDictionary initialState); SequenceBuilder<T> withTransitionMapping(Map<VertexLabel, VertexLabel> transitionMapping); FromCount count(int count); FromIterator fromIterator(Iterator<T> iterator); FromIterator fromIterator(Iterator<T> iterator, int sizeHint); static VertexLabel getUnscopedLabel(VertexLabel proxyLabel, boolean hasSequenceName);  }### Answer:
@Test public void buildSequenceFromData_Size() { Sequence sequence = new SequenceBuilder<Bean>() .fromIterator(ROWS.iterator()) .withFactory((item, bean) -> { }) .build(); assertEquals(ROWS.size(), sequence.size()); }
@Test public void buildSequenceFromData_Contents() { Sequence sequence = new SequenceBuilder<Bean>() .fromIterator(ROWS.iterator()) .withFactory((item, bean) -> { assertEquals(0, bean.x); }) .build(); }
@Test public void youCanCreateASequenceWithACommonParameterFromAnIterator() { GaussianVertex commonTheta = new GaussianVertex(0.5, 0.01); VertexLabel label = new VertexLabel("flip"); Sequence sequence = new SequenceBuilder<Bean>() .fromIterator(ROWS.iterator()) .withFactory((item, bean) -> { BooleanVertex flip = new BernoulliVertex(commonTheta); flip.observe(false); item.add(label, flip); }) .build(); for (SequenceItem item : sequence) { Vertex<DoubleTensor, ?> flip = item.get(label); assertThat(flip.getParents(), contains(commonTheta)); } }