public static int getCallCount() {
    return callCount;
  }
AlternateFailurePreListener.

An implementation of MetaStorePreEventListener which fails every other time it's invoked,
starting with the first time.

It also records and makes available the number of times it's been invoked.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/AlternateFailurePreListener.java