@Test public void testEmptyLowerBound() { SortedKeyIndex keys = SortedKeyIndex.empty(); assertThat(keys.findLowerBound(0), equalTo(0)); }
@Test public void testEmptyUpperBound() { SortedKeyIndex keys = SortedKeyIndex.empty(); assertThat(keys.findUpperBound(0), equalTo(0)); }
@Test public void testUnionSizeEmptyLSAS() { SortedKeyIndex kd = SortedKeyIndex.empty(); assertThat(unionSize(kd.keySet(), kd.keySet()), equalTo(0)); }
@Test public void testSetUnionEmptyLSAS() { SortedKeyIndex kd = SortedKeyIndex.empty(); assertThat(setUnion(kd.keySet(), kd.keySet()), hasSize(0)); }
@Test public void testEmptyMap() { Long2DoubleSortedMap map = new Long2DoubleSortedArrayMap(SortedKeyIndex.empty(), new double[0]); assertThat(map.size(), equalTo(0)); assertThat(map.isEmpty(), equalTo(true)); assertThat(map.keySet(), hasSize(0)); assertThat(map.entrySet(), hasSize(0)); assertThat(map.values(), hasSize(0)); assertThat(map.long2DoubleEntrySet(), hasSize(0)); assertThat(map.get(42L), equalTo(0.0)); assertThat(map.get((Long) 42L), nullValue()); try { map.entrySet().first(); fail("entrySet.first should fail"); } catch (NoSuchElementException e) { /* expected */ } try { map.entrySet().last(); fail("entrySet.last should fail"); } catch (NoSuchElementException e) { /* expected */ } }