code: public static int[] validate1(int[] data, String paramName){
          if(data == null) {
              return null;
          }
  
          Preconditions.checkArgument(data.length == 1,
                  "Need 1 %s value, got %s values: %s",
                          paramName, data.length, data);
  
          return data;
      }
docs: Reformats the input array to a length 1 array.
  
  If the array is length 1, returns the array
  
  @param data An array
  @param paramName The param name, for error reporting
  @return An int array of length 1 that represents the input