Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Set; public class Main { /** * is set class */ public static boolean isSet(String type) { if (type == null) { return true; } try { Class<?> c = Class.forName(type); if (Set.class.isAssignableFrom(c)) { return true; } } catch (ClassNotFoundException e) { e.printStackTrace(); } return false; } /** * override is set class */ public static boolean isSet(Class<?> type) { if (Set.class.isAssignableFrom(type)) { return true; } return false; } /** * override is set class */ public static boolean isSet(Object obj) { if (obj == null) { return false; } if (Set.class.isAssignableFrom(obj.getClass())) { return true; } return false; } }