public static <T> boolean isInSet(T value, T... set) { for (T i : set) { if (i.equals(value)) { return true; } } return false; }
public static <T extends CharSequence> T notEmpty(T chars, String message, Object... values) { message = String.format(message, values); if (chars == null) throw new NullPointerException(message); if (chars.length() == 0) throw new IllegalArgumentException(message); return chars; }