CommonUtil { public static <T> boolean isEmpty(final T[] paramTypes) { return ArrayUtils.isEmpty(paramTypes); }  static String messageFormat(final String message, final Object... params); static String getTransactionID(); static String getRandomCode(); static String getRandomNumber(final int size); static String getRandomChar(final int size); static String getString(final Object obj); static String notNullStr(final String str); static Date getDate(final Long time); static Integer[] splitId(final String idStr, final String splitor); static Long[] splitIdsByLong(final String idStr, final String splitor); static Integer[] splitId(final String idStr); static boolean wildcardMatch(final Collection<String> rules, final String matchValue); static boolean wildcardMatch(final String rule, final String matchValue); static boolean match(final String rule, final String matchValue); static String removeAllSymbol(final String str); static String replaceAllBlank(final String str); static String replaceRedundantBlank(final String str); static boolean isNotEmpty(final T[] paramTypes); static boolean isEmpty(final T[] paramTypes);  }
@Test public void isEmpty() { String str = null; Assert.isTrue(StringUtils.isEmpty(str), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("str 是null字符串"); str = ""; Assert.isTrue(StringUtils.isEmpty(str), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("str 是空字符串"); List<String> strList = null; Assert.isTrue(CollectionUtils.isEmpty(strList), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("strList 是null集合"); strList = new ArrayList<>(); Assert.isTrue(CollectionUtils.isEmpty(strList), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("strList 是空集合"); String[] strs = null; Assert.isTrue(CommonUtil.isEmpty(strs), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("strs 是null数组"); strs = new String[0]; Assert.isTrue(CommonUtil.isEmpty(strs), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("strs 是空数组"); Map<String, String> strMap = null; Assert.isTrue(MapUtils.isEmpty(strMap), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("strMap 是null Map"); strMap = new HashMap<>(); Assert.isTrue(MapUtils.isEmpty(strMap), ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("strMap 是空 Map"); }