@SafeVarargs
  private static <T> List<T> wrapArgsToListIfNeeded(final T... args) {
    List<T> out;
    if (args != null && args.length == 1 && args[0] instanceof List) {
      out = (List<T>) args[0];
    } else {
      out = Arrays.asList(args);
    }
    return out;
  }
@SafeVarargs
  private static <T> List<T> wrapArgsToListIfNeeded(final T... args) {
    List<T> out;
    if (args != null && args.length == 1 && args[0] instanceof List) {
      out = (List<T>) args[0];
    } else {
      out = Arrays.asList(args);
    }
    return out;
  }
@ SafeVarargs private static < T > List < T > wrapArgsToListIfNeeded ( final T ... args ) { List < T > out ; if ( args != null && args . length == 1 && args [ 0 ] instanceof List ) { out = ( List < T > ) args [ 0 ] ; } else { out = Arrays . asList ( args ) ; } return out ; }
Wraps arguments passed into a list if necessary.

<p>Returns the first value as is if it is the only argument and a subtype of `java.util.List`
Otherwise, it calls Arrays.asList on args

@param args arguments as a List
Wraps arguments passed into a list if necessary .