map.put((char) 11, (short) 22);
map.put((char) 12, (short) 23);
map.put((char) 13, (short) 24);
map.put((char) 14, (short) 25);
map.remove((char) 13);
map.forEachWhile(new CharShortPredicate() {
@Override
public boolean test(char first, short second) {
pairs.add(new Pair(first, second));
return true;
}
});
Collections.sort(pairs);
assertEquals(3, pairs.size());
assertEquals((char) 11, pairs.get(0).k /* keyEpsilon */);
assertEquals((short) 22, pairs.get(0).v /* valueEpsilon */);
assertEquals((char) 12, pairs.get(1).k /* keyEpsilon */);
assertEquals((short) 23, pairs.get(1).v /* valueEpsilon */);
assertEquals((char) 14, pairs.get(2).k /* keyEpsilon */);
assertEquals((short) 25, pairs.get(2).v /* valueEpsilon */);
pairs.clear();
map.forEachWhile(new CharShortPredicate() {
int count = 0;
@Override
public boolean test(char first, short second) {
pairs.add(new Pair(first, second));