@Test
  public void testPairsSortedByKey() {
    OpenIntByteHashMap map = new OpenIntByteHashMap();
    map.put((int) 11, (byte) 100);
    map.put((int) 12, (byte) 70);
    map.put((int) 13, (byte) 30);
    map.put((int) 14, (byte) 3);

    IntArrayList keys = new IntArrayList();
    ByteArrayList values = new ByteArrayList();
    map.pairsSortedByKey(keys, values);

    assertEquals(4, keys.size());
    assertEquals(4, values.size());
    assertEquals((int) 11, keys.get(0));
    assertEquals((byte) 100, values.get(0));
    assertEquals((int) 12, keys.get(1));
    assertEquals((byte) 70, values.get(1));
    assertEquals((int) 13, keys.get(2));
    assertEquals((byte) 30, values.get(2));
    assertEquals((int) 14, keys.get(3));
    assertEquals((byte) 3, values.get(3));
    keys.clear();
    values.clear();
    map.pairsSortedByValue(keys, values);
    assertEquals((int) 11, keys.get(3));
    assertEquals((byte) 100, values.get(3));
    assertEquals((int) 12, keys.get(2));
    assertEquals((byte) 70, values.get(2));
    assertEquals((int) 13, keys.get(1));
    assertEquals((byte) 30, values.get(1));
    assertEquals((int) 14, keys.get(0));
    assertEquals((byte) 3, values.get(0));
  }
 @Test
 public void testValues() {
   OpenIntByteHashMap map = new OpenIntByteHashMap();
   map.put((int) 11, (byte) 22);
   map.put((int) 12, (byte) 23);
   map.put((int) 13, (byte) 24);
   map.put((int) 14, (byte) 25);
   map.removeKey((int) 13);
   ByteArrayList values = new ByteArrayList(100);
   map.values(values);
   assertEquals(3, values.size());
   values.sort();
   assertEquals(22, values.get(0));
   assertEquals(23, values.get(1));
   assertEquals(25, values.get(2));
 }
  @Test
  public void testPairsMatching() {
    IntArrayList keyList = new IntArrayList();
    ByteArrayList valueList = new ByteArrayList();
    OpenIntByteHashMap map = new OpenIntByteHashMap();
    map.put((int) 11, (byte) 22);
    map.put((int) 12, (byte) 23);
    map.put((int) 13, (byte) 24);
    map.put((int) 14, (byte) 25);
    map.removeKey((int) 13);
    map.pairsMatching(
        new IntByteProcedure() {

          @Override
          public boolean apply(int first, byte second) {
            return (first % 2) == 0;
          }
        },
        keyList,
        valueList);
    keyList.sort();
    valueList.sort();
    assertEquals(2, keyList.size());
    assertEquals(2, valueList.size());
    assertEquals(12, keyList.get(0));
    assertEquals(14, keyList.get(1));
    assertEquals(23, valueList.get(0));
    assertEquals(25, valueList.get(1));
  }