### Question:
SequenceSet extends LinkedNodeList<Sequence> implements Iterable<Long> { public Iterator<Long> iterator() { return new SequenceIterator(); }  void add(Sequence value); boolean add(long value); boolean remove(long value); long removeFirst(); Sequence removeLastSequence(); Sequence removeFirstSequence(long count); List<Sequence> getMissing(long first, long last); List<Sequence> getReceived(); boolean contains(long value); boolean contains(int first, int last); Sequence get(int value); long rangeSize(); Iterator<Long> iterator();  }### Answer:
@Test public void testIterator() { SequenceSet set = new SequenceSet(); set.add(new Sequence(0, 2)); set.add(new Sequence(4, 5)); set.add(new Sequence(7)); set.add(new Sequence(20, 21)); long expected[] = new long[]{0, 1, 2, 4, 5, 7, 20, 21}; int index = 0; Iterator<Long> iterator = set.iterator(); while(iterator.hasNext()) { assertEquals(expected[index++], iterator.next().longValue()); } }
@Test public void testIteratorEmptySequenceSet() { SequenceSet set = new SequenceSet(); Iterator<Long> iterator = set.iterator(); while(iterator.hasNext()) { fail("Should not have any elements"); } }