@Test public void minKey() { TreeMap<Integer, Integer> t1 = TreeMap.<Integer, Integer>empty(Ord.intOrd); assertThat(t1.minKey(), equalTo(none())); TreeMap<Integer, Integer> t2 = t1.set(1, 2).set(2, 4).set(10, 20).set(5, 10).set(0, 100); assertThat(t2.minKey(), equalTo(some(0))); assertThat(t2.delete(0).minKey(), equalTo(some(1))); }
@Test public void testLargeInserts() { // check that inserting a large number of items performs ok // taken from https://code.google.com/p/functionaljava/issues/detail?id=31 and // https://github.com/functionaljava/functionaljava/pull/13/files final int n = 10000; TreeMap<Integer, String> m = TreeMap.empty(Ord.intOrd); for (int i = 0; i < n; i++) { m = m.set(i, "abc " + i); } }