@Override
  public UserGroupInformation cloneUgi(UserGroupInformation baseUgi) throws IOException {
    // Based on UserGroupInformation::createProxyUser.
    // TODO: use a proper method after we can depend on HADOOP-13081.
    if (getSubjectMethod == null) {
      throw new IOException("The UGI method was not found: " + ugiCloneError);
    }
    try {
      Subject origSubject = (Subject) getSubjectMethod.invoke(baseUgi);
      Subject subject = new Subject(false, origSubject.getPrincipals(),
          cloneCredentials(origSubject.getPublicCredentials()),
          cloneCredentials(origSubject.getPrivateCredentials()));
      return ugiCtor.newInstance(subject);
    } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
      throw new IOException(e);
    }
  }
Compares two encryption key strengths.

@param zone1 First  EncryptionZone to compare
@param zone2 Second EncryptionZone to compare
@return 1 if zone1 is stronger; 0 if zones are equal; -1 if zone1 is weaker.
@throws IOException If an error occurred attempting to get key metadata
shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java