### Question:
SequenceSet extends LinkedNodeList<Sequence> implements Iterable<Long> { public boolean remove(long value) { Sequence sequence = getHead(); while (sequence != null ) { if(sequence.contains(value)) { if (sequence.range() == 1) { sequence.unlink(); return true; } else if (sequence.getFirst() == value) { sequence.setFirst(value+1); return true; } else if (sequence.getLast() == value) { sequence.setLast(value-1); return true; } else { sequence.linkBefore(new Sequence(sequence.first, value-1)); sequence.linkAfter(new Sequence(value+1, sequence.last)); sequence.unlink(); return true; } } sequence = sequence.getNext(); } return false; }  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 testRemove() { SequenceSet set = new SequenceSet(); set.add(new Sequence(0, 100)); assertEquals(101, set.rangeSize()); assertEquals(1, set.size()); assertFalse(set.remove(101)); assertTrue(set.remove(50)); assertEquals(2, set.size()); assertEquals(100, set.rangeSize()); assertFalse(set.remove(101)); set.remove(0); assertEquals(2, set.size()); assertEquals(99, set.rangeSize()); set.remove(100); assertEquals(2, set.size()); assertEquals(98, set.rangeSize()); set.remove(10); assertEquals(3, set.size()); assertEquals(97, set.rangeSize()); }