code: public static void validateNonNegative(int[] data, String paramName){
  
          if(data == null) {
              return;
          }
  
          boolean nonnegative = true;
  
          for(int value : data){
              if(value < 0) {
                  nonnegative = false;
              }
          }
  
          Preconditions.checkArgument(nonnegative,
                  "Values for %s must be >= 0, got: %s", paramName, data);
      }
docs: Checks that all values are >= 0.
  
  @param data An array
  @param paramName The param name, for error reporting