code: private static <T> int indexOfNullElement(T[] array) {
          for (int i = 0; i < array.length; i++) {
              if (array[i] == null) {
                  return i;
              }
          }
          return -1;
      }
docs: Returns the index of the first null element, or {@code -1} if no null element was found.
  
  @param array
  the array to check for null elements
  @param <T>
  the type of the array elements
  
  @return the index of the first null element, or {@code -1} if no null element was found