code: private static String[] appendToStringArray(String[] array, String element) {
          if (array != null) {
              String[] newArray = new String[array.length + 1];
              System.arraycopy(array, 0, newArray, 0, array.length);
              newArray[array.length] = element;
              return newArray;
          } else {
              return new String[]{element};
          }
      }
docs: Appends the given element to a copy of the given array.
  
  @param array   The array to copy.
  @param element The element to append.
  @return An Array with the element appended.