code: @Override
      public double d(T[] x, T[] y) {
          if (x.length != y.length)
              throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
  
          int dist = 0;
          for (int i = 0; i < x.length; i++) {
              if (!x[i].equals(y[i]))
                  dist++;
          }
  
          return dist;
      }
docs: Returns Hamming distance between the two arrays.