public static boolean isEmpty(Object obj) {
if (obj instanceof String)
return obj == null || ("".equals(obj));
else if (obj instanceof Collection) {
return obj == null || ((Collection<?>) obj).isEmpty();
} else if (obj instanceof Object[]) {
return obj == null || ((Object[]) obj).length == 0;
} else
return obj == null;
}
if (obj instanceof String)
return obj == null || ("".equals(obj));
else if (obj instanceof Collection) {
return obj == null || ((Collection<?>) obj).isEmpty();
} else if (obj instanceof Object[]) {
return obj == null || ((Object[]) obj).length == 0;
} else
return obj == null;
}