@Override
    public boolean equals(Object obj) {
      if (!(obj instanceof CacheKey)) {
        return false;
      }
      CacheKey other = (CacheKey) obj;
      return caKeyType == other.caKeyType && certKeyType == other.certKeyType
        && Arrays.equals(keyPassword, other.keyPassword);
    }
Will cache X509TestContext to speed up tests.
hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/X509TestContextProvider.java