@Test
public void testToArray() {

  FoldedTreeSet<Integer> tree = new FoldedTreeSet<>();
  ArrayList<Integer> list = new ArrayList<>(256);
  for (int i = 0; i < 256; i++) {
    list.add(1024 + i);
  }
  tree.addAll(list);
  assertArrayEquals(list.toArray(), tree.toArray());
}