code: static String[] uniquify(String[] arr, boolean alwaysClone) {
          int numUnique = uniquifyCountAndCopy(arr, null);
          if (numUnique == 0)
              return EMPTY_STRING_ARRAY;
          if (numUnique == arr.length)
              return alwaysClone ? arr.clone() : arr;
  
          String[] out = new String[numUnique];
          uniquifyCountAndCopy(arr, out);
          return out;
      }
docs: Remove null and duplicate elements from an array.
  
  @param arr the input array
  @param alwaysClone true if the input array should be copied even if it
  doesn't contain nulls or duplicates
  @return the output array