Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.LongSet.retainAll()


    @Test
    public void testRetainAll() {
        LongKeyDomain lks = LongKeyDomain.create(20, 25, 30, 42, 62, 99);
        LongSet ls = lks.modifiableActiveSetView();
        List<Long> rm = Longs.asList(20, 25, 62, 30, 98, 1);
        assertThat(ls.retainAll(rm), equalTo(true));
        assertThat(ls, contains(20L, 25L, 30L, 62L));
        assertThat(Lists.newArrayList(lks.activeIndexIterator(false)),
                   contains(0, 1, 2, 4));
    }
View Full Code Here


    @Test
    public void testRetainAllEmptyList() {
        LongKeyDomain lks = LongKeyDomain.create(20, 25, 30, 42, 62, 99);
        LongSet ls = lks.modifiableActiveSetView();
        assertThat(ls.retainAll(Lists.newArrayList()), equalTo(true));
        assertThat(ls.isEmpty(), equalTo(true));
    }

    @Test
    public void testRetainAllLongMaxLong() {
View Full Code Here

    @Test
    public void testRetainAllLongMaxLong() {
        LongKeyDomain lks = LongKeyDomain.create(20, Long.MAX_VALUE);
        LongSet ls = lks.modifiableActiveSetView();
        assertThat(ls.retainAll(Lists.newArrayList()), equalTo(true));
        assertThat(ls.isEmpty(), equalTo(true));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.