code: public static String[] unique(String[] x) {
          HashSet<String> hash = new HashSet<>(Arrays.asList(x));
  
          String[] y = new String[hash.size()];
  
          Iterator<String> keys = hash.iterator();
          for (int i = 0; i < y.length; i++) {
              y[i] = keys.next();
          }
  
          return y;
      }
docs: Find unique elements of vector.
  @param x an array of strings.
  @return the same values as in x but with no repetitions.