public static void empty(final Collection<?> collection,final String name){
  if (!collection.isEmpty()) {
    final String message=String.format("%s must be empty",name);
    throw new IllegalArgumentException(message);
  }
}

public static void empty ( final Collection < ? > collection , final String name ) { if ( ! collection . isEmpty ( ) ) { final String message = String . format ( "%s must be empty" , name ) ; throw new IllegalArgumentException ( message ) ; } }
throws an exception if the specified collection is not empty .
