@Test
public void testComparator() {

  Comparator<String> comparator = new Comparator<String>() {
    @Override
    public int compare(String o1, String o2) {
      return o1.compareTo(o2);
    }
  };
  assertEquals(null, new FoldedTreeSet<>().comparator());
  assertEquals(comparator, new FoldedTreeSet<>(comparator).comparator());
  FoldedTreeSet<String> set = new FoldedTreeSet<>(comparator);
  set.add("apa3");
  set.add("apa2");
  set.add("apa");
  set.add("apa5");
  set.add("apa4");
  assertEquals(5, set.size());
  assertEquals("apa", set.get("apa"));
}