public static < K , V > Map < K , V > checkNotNullOrEmpty ( Map < K , V > arg , String argName ) throws NullPointerException , IllegalArgumentException { Preconditions . checkNotNull ( arg , argName ) ; checkArgument ( ! arg . isEmpty ( ) , argName , "Cannot be an empty map." ) ; return arg ; }
Throws a NullPointerException if the arg argument is null . Throws an IllegalArgumentException if the Map arg argument has a size of zero .