@Override
  public boolean addPartitions(String catName, String dbName, String tblName, List<Partition> parts)
    throws InvalidObjectException, MetaException {
    if (addPartitionsModifier != null) {
      Boolean success = addPartitionsModifier.apply(parts);
      if ((success != null) && !success) {
        throw new MetaException("InjectableBehaviourObjectStore: Invalid addPartitions operation on Catalog : "
          + catName + " DB: " + dbName + " table: " + tblName);
      }
    }
    return super.addPartitions(catName, dbName, tblName, parts);
  }
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