public static boolean shouldSkip(String storageFormat, Map<String, Set<String>> disabledTestsMap) {
    final StackTraceElement[] elements = Thread.currentThread().getStackTrace();
    // The "bottom" of the call stack is at the front of the array. The elements are as follows:
    //   [0] getStackTrace()
    //   [1] shouldSkip()
    //   [2] caller test method
    String methodName = elements[2].getMethodName();
    if (!disabledTestsMap.containsKey(storageFormat)) {
      return false;
    }

    Set<String> disabledMethods = disabledTestsMap.get(storageFormat);
    return disabledMethods.contains(methodName);
  }
Determine whether the caller test method is in a set of disabled test methods for a given
storage format.

@param storageFormat The name of the storage format used in a STORED AS clause.
@param disabledTestsMap Map of storage format name to set of test method names that indicate
       which test methods should not run against the given storage format.
@return True if the caller test method should be skipped for the given storage format.
hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/TestUtil.java