testGetKthOrder() {
    const tree = new AvlTree((a, b) => a - b);

    const NUM_TO_INSERT = 2000;
    const NUM_TO_REMOVE = 500;

    // Insert ints into tree out of order
    for (let i = 0; i < NUM_TO_INSERT; i += 1) {
      tree.add(i);
    }

    // Remove values.
    for (let i = 0; i < NUM_TO_REMOVE; i += 1) {
      tree.remove(i);
    }
    for (let k = 0; k < tree.getCount(); ++k) {
      assertEquals(NUM_TO_REMOVE + k, tree.getKthValue(k));
    }
  }
This test verifies that getKthOrder gets the correct value.