@Override
  public List<Partition> alterPartitions(String catName, String dbname, String name,
                                  List<List<String>> part_vals, List<Partition> newParts,
                                  long writeId, String queryWriteIdList)
          throws InvalidObjectException, MetaException {
    if (alterPartitionsModifier != null) {
      Boolean success = alterPartitionsModifier.apply(newParts);
      if ((success != null) && !success) {
        throw new MetaException("InjectableBehaviourObjectStore: Invalid alterPartitions operation on Catalog : "
                + catName + " DB: " + dbname + " table: " + name);
      }
    }
    return super.alterPartitions(catName, dbname, name, part_vals, newParts, writeId, queryWriteIdList);
  }
A utility class to pass the arguments of the caller to the stub method.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/InjectableBehaviourObjectStore.java