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