class ArgChecker {

  public static double[] noDuplicates(double[] argument, String name) {
    notNull(argument, name);
    if (argument.length > 1) {
      Set<Double> seen = new LinkedHashSet<>();
      for (double v : argument) {
        if (!seen.add(v)) {
          throw new IllegalArgumentException(noDuplicatesArrayMsg(name));
        }
      }
    }
    return argument;
  }

  private  ArgChecker();

}