@SuppressWarnings("unchecked")
    public static <E> E get(Object list, int i) {
        if (list == null)
            throw new IndexOutOfBoundsException();

        if (list instanceof List)
            return (E) ((List<?>) list).get(i);

        if (i == 0)
            return (E) list;

        throw new IndexOutOfBoundsException();
    }
@ SuppressWarnings ( "unchecked" ) public static < E > E get ( Object list , int i ) { if ( list == null ) throw new IndexOutOfBoundsException ( ) ; if ( list instanceof List ) return ( E ) ( ( List < ? > ) list ) . get ( i ) ; if ( i == 0 ) return ( E ) list ; throw new IndexOutOfBoundsException ( ) ; }
Get item from the list

@param list A LazyList returned from LazyList.add(Object) or null
@param i    int index
@param <E>  the list entry type
@return the item from the list.