@Test
public void testFillRatio() {

  FoldedTreeSet<Integer> set = new FoldedTreeSet<>();
  final int size = 1024;
  for (int i = 1; i <= size; i++) {
    set.add(i);
    assertEquals("Iteration: " + i, 1.0, set.fillRatio(), 0.0);
  }
  for (int i = 1; i <= size / 2; i++) {
    set.remove(i * 2);
    // Need the max since all the removes from the last node doesn't
    // affect the fill ratio
    assertEquals("Iteration: " + i,
                 Math.max((size - i) / (double) size, 0.53125),
                 set.fillRatio(), 0.0);
  }
}