@Test
public void testAddOrReplace() {

  FoldedTreeSet<String> simpleSet = new FoldedTreeSet<>();
  String entry = "apa";
  assertNull(simpleSet.addOrReplace(entry));
  assertEquals(entry, simpleSet.addOrReplace(entry));
  FoldedTreeSet<Integer> intSet = new FoldedTreeSet<>();
  for (int i = 0; i < 1024; i++) {
    assertNull(intSet.addOrReplace(i));
  }
  for (int i = 0; i < 1024; i++) {
    assertEquals(i, intSet.addOrReplace(i).intValue());
  }
}