DiffListBySkipList implements DiffList<DirectoryDiff> { @Override public boolean addLast(DirectoryDiff diff) { final int nodeLevel = DirectoryDiffListFactory.randomLevel(); final SkipListNode[] nodePath = findPreviousNodes(null, nodeLevel); final SkipListNode newNode = new SkipListNode(diff, nodeLevel); for (int level = 0; level <= nodeLevel; level++) { if (level > 0 && nodePath[level] != head) { ChildrenDiff combined = combineDiff(nodePath[level], newNode, level); if (combined != null) { nodePath[level].setSkipDiff(combined, level); } } nodePath[level].setSkipTo(newNode, level); newNode.setSkipTo(null, level); } return skipNodeList.add(newNode); } DiffListBySkipList(int capacity); @Override void addFirst(DirectoryDiff diff); @Override boolean addLast(DirectoryDiff diff); @Override DirectoryDiff get(int index); @Override DirectoryDiff remove(int index); @Override boolean isEmpty(); @Override int size(); @Override Iterator<DirectoryDiff> iterator(); @Override int binarySearch(int key); @Override List<DirectoryDiff> getMinListForRange(int fromIndex, int toIndex,
      INodeDirectory dir); @Override String toString(); static final Logger LOG; }
@Test public void testAddLast() throws Exception { testAddLast(NUM_SNAPSHOTS); }