code: private void ensureCapacityAndAddPair(KeyValuePair kvp) {
          if (lastIndex + 1 < pairs.length) {
              pairs[++lastIndex] = kvp;
          } else {
              pairs = java.util.Arrays.copyOf(pairs, Math.max(pairs.length + (pairs.length >> 1), DEFAULT_SIZE));
              pairs[++lastIndex] = kvp;
          }
      }
docs: /* Resizes pairs array when full