public static int collectionContainsAll(Collection<?> c,Collection<?> c2){
  int mismatch=0;
  for (  Object o : c2) {
    if (!c.contains(o))     mismatch++;
  }
  return mismatch > 0 ? -mismatch : c2.size() + 1;
}

public static int collectionContainsAll ( Collection < ? > c , Collection < ? > c2 ) { int mismatch = 0 ; for ( Object o : c2 ) { if ( ! c . contains ( o ) ) mismatch ++ ; } return mismatch > 0 ? - mismatch : c2 . size ( ) + 1 ; }
helper function that is called instead of collection . containsall
