code: private String[] growArray(String[] oldArray, String newElement) {
          // Look for the element first
          for (String element : oldArray) {
              if (element.equals(newElement)) {
                  // If it's already there, we're done
                  return oldArray;
              }
          }
          log.debug("Adding ID: '{}'", newElement);
  
          // Ok, we know we need a new array
          int length = oldArray.length + 1;
          String[] newArray = new String[length];
          // Copy the old array contents
          System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
          // And the new element, and return
          newArray[length - 1] = newElement;
          return newArray;
      }
docs: Check the array for the new element, and if not found, generate a new
  array containing all of the old elements plus the new.
  
  @param oldArray The old array of data
  @param newElement The new element we want
  @return String[] An array containing all of the old data