@Test public void toMap() { MutableList<Integer> integers = SingletonListTest.newWith(1); MutableMap<Integer, Integer> map = integers.toMap(Functions.getIntegerPassThru(), Functions.getIntegerPassThru()); Verify.assertContainsAll(map.keySet(), 1); Verify.assertContainsAll(map.values(), 1); }
@Test public void toSortedListBy() { MutableList<Integer> integers = SingletonListTest.newWith(1); MutableList<Integer> list = integers.toSortedListBy(Functions.getIntegerPassThru()); Assert.assertEquals(FastList.newListWith(1), list); Assert.assertNotSame(integers, list); }
@Test public void betweenExclusiveNumber() { assertBetweenExclusive(Predicates.betweenExclusive(1, 3)); assertBetweenExclusive( Predicates.attributeBetweenExclusive(Functions.getIntegerPassThru(), 1, 3)); }
@Override @Test(expected = UnsupportedOperationException.class) public void getIfAbsentPutWithKey() { this.newMapWithKeysValues(1, 1, 2, 2, 3, 3) .getIfAbsentPutWithKey(4, Functions.getIntegerPassThru()); }