@Override public Statement apply(Statement statement, Description description) {
    return new Statement() {
      @Override public void evaluate() throws Throwable {
        ConditionalIgnoreOnSessionHiveMetastoreClient annotation =
            description.getAnnotation(ConditionalIgnoreOnSessionHiveMetastoreClient.class);
        if (annotation != null) {
          Assume.assumeTrue("Test is ignored", false);
        } else {
          statement.evaluate();
        }
      }
    };
  }
This rule checks the existance of {@link ConditionalIgnoreOnSessionHiveMetastoreClient} annotation.
If the annotation is present, skips the execution of the test.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/CustomIgnoreRule.java