LongVec { private LongVec(int capacity) { data = new long[capacity]; len = 0; } private  LongVec(int capacity); private  LongVec(long[] data); static LongVec create(); static LongVec withCapacity(int capacity); static LongVec wrap(long[] data); int capacity(); int len(); boolean isEmpty(); void reserve(int additional); void reserveExact(int additional); void shrinkToFit(); void truncate(int len); void clear(); void push(long element); void set(int index, long value); void concat(LongVec other); long get(int index); void sort(); void merge(LongVec other); void intersect(LongVec other); void dedup(); Iterator iterator(); List<Long> asList(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testLongVec() throws Exception { checkLongVec(random(0)); checkLongVec(random(1)); checkLongVec(random(2)); checkLongVec(random(3)); checkLongVec(random(LongVec.DEFAULT_CAPACITY - 2)); checkLongVec(random(LongVec.DEFAULT_CAPACITY - 1)); checkLongVec(random(LongVec.DEFAULT_CAPACITY)); checkLongVec(random(LongVec.DEFAULT_CAPACITY + 1)); checkLongVec(random(LongVec.DEFAULT_CAPACITY + 2)); for (int i = 0; i < 100; i++) { checkLongVec(random()); } }