Utils { public static boolean isStringBlank(String text) { return impl.isStringBlank(text); } private  Utils(); static boolean isStringEmpty(String text); static boolean isStringNotEmpty(String text); static boolean areAllStringsEmpty(String... values); static boolean isAtLeastOneStringNotEmpty(String... values); static boolean isStringBlank(String text); static boolean isStringNotBlank(String text); static boolean areStringsEqual(String text1, String text2); static boolean areStringsEqualIgnoreCase(String text1, String text2); static boolean isStringDigits(String text); static String trim(String text); static String joinStrings(List<String> strings, String separator); static String substringAfter(String text, String after); static boolean endsWithIgnoreCase(String text, String expected); static String lowerCase(String text); static String upperCase(String text); static boolean isArrayEmpty(Object[] array); static boolean isArrayNotEmpty(Object[] array); static boolean isArrayNotEmpty(byte[] array); static boolean isArrayEmpty(byte[] array); static byte[] subarray(byte[] array, int start, int length); static boolean isTrue(Boolean bool); @SuppressWarnings("rawtypes") static boolean isCollectionEmpty(Collection collection); @SuppressWarnings("rawtypes") static boolean isCollectionNotEmpty(Collection collection); static boolean isMapEmpty(Map<?,?> map); static boolean isMapNotEmpty(Map<?,?> map); @SuppressWarnings("rawtypes") static int collectionSize(Collection collection); static String toHex(byte[] bytes); static byte[] fromHex(String hex); static boolean isBase64Encoded(String base64String); static String toBase64(byte[] bytes); static byte[] fromBase64(String base64); static byte[] toByteArray(InputStream is); static void closeQuietly(Closeable closeable); static void copy(InputStream is, OutputStream os); static void write(byte[] content, OutputStream os); static long getInputStreamSize(InputStream is); static void cleanDirectory(File directory); static Collection<File> listFiles(File folder, String[] extensions, boolean recursive); static final String EMPTY_STRING; }
@Test public void testNoImplementationException() { ExceptionInInitializerError exception = assertThrows(ExceptionInInitializerError.class, () -> { Utils.isStringBlank("test"); }); assertEquals("No implementation found for IUtils in classpath, please choose between dss-utils-apache-commons or dss-utils-google-guava", exception.getMessage()); }