SequenceIDBuffer implements IndexedSortable { @Override public void swap(int leftIndex, int rightIndex) { long left = get(leftIndex); long right = get(rightIndex); put(leftIndex, right); put(rightIndex, left); } SequenceIDBuffer(int size); @Override int compare(int leftIndex, int rightIndex); boolean exists(long value); @Override void swap(int leftIndex, int rightIndex); long get(int index); void put(int index, long value); int size(); void close(); void sort(); static void main(String[] args);  }
@Test public void testSwap() { SequenceIDBuffer buffer = new SequenceIDBuffer(2); buffer.put(0, Long.MAX_VALUE); buffer.put(1, Long.MIN_VALUE); buffer.swap(0, 1); Assert.assertEquals(buffer.get(0), Long.MIN_VALUE); Assert.assertEquals(buffer.get(1), Long.MAX_VALUE); }