SplitMap { public long getCardinality() { return index.reduceLong(0L, Container::getCardinality, (x, y) -> x + y); } SplitMap(PrefixIndex<Container> index, KeyInvolution involution);  SplitMap(PrefixIndex<Container> index);  SplitMap(KeyInvolution involution); void insert(short key, Container region); boolean contains(int value); long getCardinality(); boolean isEmpty(); Stream<PrefixIndex<Container>> stream();  }
@Test public void testCardinality() { SplitMapPageWriter writer = new SplitMapPageWriter(); writer.add(1); writer.add(1 << 14); writer.add(1 << 16 | 1); writer.add(1 << 17); assertEquals(writer.toSplitMap().getCardinality(), 4); }