@Test
public void testSort() {

  int records = 1_000_000;
  DoubleColumn numberColumn = DoubleColumn.create("test", records);
  for (int i = 0; i < records; i++) {
    numberColumn.set(i, Math.random());
  }
  numberColumn.sortAscending();
  double last = Double.NEGATIVE_INFINITY;
  for (double n : numberColumn) {
    assertTrue(n >= last);
    last = n;
  }
  numberColumn.sortDescending();
  last = Double.POSITIVE_INFINITY;
  for (double n : numberColumn) {
    assertTrue(n <= last);
    last = n;
  }
  records = 10;
  numberColumn = DoubleColumn.create("test", records);
  for (int i = 0; i < records; i++) {
    numberColumn.set(i, Math.random());
  }
  numberColumn.sortDescending();
  last = Double.POSITIVE_INFINITY;
  for (double n : numberColumn) {
    assertTrue(n <= last);
    last = n;
  }
}