### Question:
LinkedCell { LinkedCell<T> remove() { if (this.previous != null) { this.previous.next = this.next; } if (this.next != null) { this.next.previous = this.previous; } this.previous = null; this.next = null; return this; } LinkedCell(final T value); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); static void main(final String[] args);  }### Answer:
@Test public void testRemove() { final int length = 10; final List<Integer> answer = new LinkedList<>(); final LinkedCell<Integer> cell = new LinkedCell<>(0); answer.add(0); for (int i = 1; i < length; i++) { cell.insertNext(new LinkedCell<>(i)); answer.add(1, i); } Assert.assertEquals(answer.remove(1), cell.getNext().remove().get()); LinkedCell<Integer> cur = cell; Assert.assertNull(cur.getPrevious()); for (int i = 0; i < answer.size(); i++) { Assert.assertEquals(answer.get(i), cur.get()); cur = cur.getNext(); } Assert.assertNull(cur); for (cur = cell; cur.getNext() != null; cur = cur.getNext()) { } Assert.assertEquals(answer.remove(answer.size() - 1), cur.remove().get()); cur = cell; Assert.assertNull(cur.getPrevious()); for (int i = 0; i < answer.size(); i++) { Assert.assertEquals(answer.get(i), cur.get()); cur = cur.getNext(); } Assert.assertNull(cur); cur = cell.getNext(); Assert.assertEquals(answer.remove(0), cell.remove().get()); Assert.assertNull(cur.getPrevious()); for (int i = 0; i < answer.size(); i++) { Assert.assertEquals(answer.get(i), cur.get()); cur = cur.getNext(); } Assert.assertNull(cur); }