AssembleUtil { public static <T extends Comparable<? super T>>boolean containsAll(final T[] a, final T[] b) { for (int i = 0, j = 0;;) { if (j == b.length) return true; if (i == a.length) return false; final int comparison = a[i].compareTo(b[j]); if (comparison > 0) return false; ++i; if (comparison == 0) ++j; } } private  AssembleUtil(); static boolean hasFileInJar(final File jarFile, final String name); static String readFileFromJar(final File jarFile, final String name); static Set<String> getLocations(final Class<?> ... classes); static byte[] readBytes(final URL url); static byte[] readBytes(final InputStream in); static String toIndentedString(final Object[] a); static String toIndentedString(final Collection<?> l); static String toIndentedString(final Map<?,?> m); static boolean recurseDir(final File dir, final Predicate<File> predicate); static FileVisitResult recurseDir(final File dir, final Function<File,FileVisitResult> function); static int compare(final T[] a, final T[] b); static int compare(final List<T> a, final List<T> b); static boolean containsAll(final T[] a, final T[] b); static boolean containsAll(final T[] a, final T[] b, final Comparator<T> c); @SuppressWarnings("unchecked") static T[] retain(final T[] a, final T[] b, final int i, final int j, final int r); static T[] sort(final T[] array); static List<T> sort(final List<T> list); static String getNameId(final Object obj); static String getSimpleNameId(final Object obj); static String toString(final Object[] a, final String del); static String toString(final Collection<?> c, final String del); static void absorbProperties(final String command); static void forEachClass(final URL[] urls, final T arg, final BiConsumer<String,T> consumer); static URL toURL(final File file); static URL[] toURLs(final File ... files); static URL[] toURLs(final List<File> files); static URL[] toURLs(final Collection<File> files); static String convertToRegex(String pattern); static String classNameToResource(final String className); static String classNameToResource(final Class<?> cls); static String resourceToClassName(final String resource); static boolean isSystemProperty(final String key, final String deprecatedKey); static Pattern convertToNameRegex(String pattern); static File getSourceLocation(final URL url, final String resourcePath); static String getName(final String path); static File[] classPathToFiles(final String classpath); static URL toURL(final String path);  }
@Test public void testContainsAll() { String[] a, b; a = new String[] {"a", "b", "c", "d"}; b = new String[] {"a", "b", "c", "d"}; assertTrue(AssembleUtil.containsAll(a, b)); a = new String[] {"b", "c", "d"}; b = new String[] {"a", "b", "c", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "c", "d"}; b = new String[] {"b", "c", "d"}; assertTrue(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "c"}; b = new String[] {"a", "b", "c", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "c", "d"}; b = new String[] {"a", "b", "c"}; assertTrue(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "d"}; b = new String[] {"a", "b", "c", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "c", "d"}; b = new String[] {"a", "b", "d"}; assertTrue(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "c", "d"}; b = new String[] {"a", "b", "c", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "c", "d"}; b = new String[] {"a", "c", "d"}; assertTrue(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "d"}; b = new String[] {"a", "b", "c", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "c", "d"}; b = new String[] {"a", "d"}; assertTrue(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "c", "d"}; b = new String[] {"a", "b", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b", "d"}; b = new String[] {"a", "c", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"c", "d"}; b = new String[] {"a", "b", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b"}; b = new String[] {"a", "c"}; assertFalse(AssembleUtil.containsAll(a, b)); a = new String[] {"a", "b"}; b = new String[] {"c", "d"}; assertFalse(AssembleUtil.containsAll(a, b)); }