code: public static Object getIndex(Object array, int index)
              throws UtilTargetError {
          Interpreter.debug("getIndex: ", array, ", index=", index);
          try {
              if ( array instanceof List )
                  return ((List<?>) array).get(index);
              Object val = Array.get(array, index);
              return Primitive.wrap( val, Types.arrayElementType(array.getClass()) );
          } catch( IndexOutOfBoundsException e1 ) {
              int len = array instanceof List
                      ? ((List<?>) array).size()
                      : Array.getLength(array);
              throw new UtilTargetError("Index " + index
                      + " out-of-bounds for length " + len, e1);
          }
      }
docs: Get object from array or list at index.
  @param array to retrieve from
  @param index of the element to retrieve
  @return Array.get for array or List.get for list
  @throws UtilTargetError wrapped Index out of bounds