Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Collections; public class Main { @SuppressWarnings("unchecked") public static boolean checkListType(Object target, Class<?> classz) { try { if (Collections.checkedCollection((Collection) target, classz).size() > 0) { return true; } } catch (Exception e) { return false; } return false; } }