code: public static Object getElementFromArrary(Object array, int index) {
      try {
        return Array.get(array, index);
      } catch (ArrayIndexOutOfBoundsException e) {
        return null;
      }
    }
docs: Gets the element from an array with given index.
  
  @param array the array
  @param index the index
  @return null if the array doesn't have the element at index, otherwise, return the element