public void testIterate() { long[] values = LongProgression.Arithmetic.range(0, 101, 5).toNativeArray(); int size = values.length; AbstractLongListDecorator.LongVisitor[] visitors = {
public void testMergeFromSortedCollection() { LongArray expected = LongArray.create(0, 10, 20); for (LongSetBuilder builder : createSets(expected)) { builder.mergeFromSortedCollection(LongProgression.Arithmetic.range(1, 30, 10)); expected.addAll(LongProgression.Arithmetic.range(1, 30, 10)); expected.sortUnique(); checkSet(builder, expected); builder.mergeFromSortedCollection(LongList.EMPTY); checkSet(builder, expected); CHECK.order(expected, builder.commitToArray()); try { builder.mergeFromSortedCollection(LongList.EMPTY); fail(); } catch (IllegalStateException _) { // ok } } } }
public void testSetAllBorders() { array.addAll(LongProgression.Arithmetic.range(1050)); array.removeRange(0, 10); try { array.setAll(-5, LongArray.create(-1, -1), 0, 2); fail(); } catch (IndexOutOfBoundsException _) { // ok } } }
public void testSimple() { LongList[] lists = {LongList.EMPTY, new LongList.Single(10), LongArray.create(0, 1, 2), LongProgression.Arithmetic.range(3), null}; for (LongList list : lists) { assertEquals(0, comparator.compare(list, list)); } assertEquals(-1, comparator.compare(null, LongArray.create(0, 1, 2))); assertEquals(0, comparator.compare(lists[2], lists[3])); assertEquals(0, comparator.compare(lists[2], lists[2].iterator())); } }