public static void main(String[] args) {

        ArrayList<Integer> intList = new ArrayList<>();
        ArrayList<Double> dblList = new ArrayList<>();

        // if(intList instanceof ArrayList<Integer>) {} //complier error
        // if(intList instanceof ArrayList<E>) {} //complier error
        
        if (intList instanceof ArrayList<?>) {
        } // works fine

        if (intList instanceof ArrayList) {
        } // works fine

        Class<?> class1 = intList.getClass(); // return ArrayList.class
        Class<?> class2 = dblList.getClass(); // return ArrayList.class

        if (class1.equals(class2)) {
        } // yes

        ArrayList<Integer> newRef1 = intList;
        ArrayList<? extends Number> newRef2 = newRef1;
        ArrayList<?> newRef3 = newRef2;
        newRef3.getClass(); // only to avoid warning
    }