public static ListMultimap<String, UserPermission>
    toUserPermission(AccessControlProtos.UsersAndPermissions proto) {
    ListMultimap<String, UserPermission> userPermission = ArrayListMultimap.create();
    AccessControlProtos.UsersAndPermissions.UserPermissions userPerm;
    for (int i = 0; i < proto.getUserPermissionsCount(); i++) {
      userPerm = proto.getUserPermissions(i);
      String username = userPerm.getUser().toStringUtf8();
      for (int j = 0; j < userPerm.getPermissionsCount(); j++) {
        userPermission.put(username,
          new UserPermission(username, toPermission(userPerm.getPermissions(j))));
      }
    }
    return userPermission;
  }
Convert a protobuf UserTablePermissions to a ListMultimap&lt;Username, UserPermission&gt
@param proto the proto UsersAndPermissions
@return a ListMultimap with user and its permissions
hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlUtil.java