public static boolean containsAll(final ByteCollection/*<?>*/ collection,
Collection<?> another) {
if (collection == another)
return true;
if (another instanceof ByteCollection) {
ByteCollection c2 = (ByteCollection) another;
/* if obj elem */
if (collection.equivalence().equals(c2.equivalence())) {
/* endif */
if (collection instanceof ByteSet && c2 instanceof ByteSet &&
collection.size() < another.size()) {
return false;
}
if (c2 instanceof InternalByteCollectionOps) {
// noinspection unchecked
return ((InternalByteCollectionOps) c2).allContainingIn(collection);
}
/* if obj elem */
}
// noinspection unchecked
/* endif */
return c2.forEachWhile(new
/*f*/BytePredicate/**/() {
@Override
public boolean test(/* raw */byte value) {
return collection.contains(value);
}