code: static public Object[] put(Object[] array, Object key, Object value)
      {
          if (array != null)
          {
              int length = array.length;
  
              for (int i = 0; i < length; i += 2)
              {
                  Object curKey = array[i];
  
                  if (((curKey != null) && (curKey.equals(key)))
                          || (curKey == key))
                  {
                      array[i + 1] = value;
                      return array;
                  }
              }
          }
  
          return _addToArray(array, key, value, 1);
      }
docs: Adds the key/value pair to the array, returning a
  new array if necessary.