code: public ExceptionThrownRule getExceptionThrownRule(Throwable ex) {
          ExceptionThrownRule exceptionThrownRule = null;
          int deepest = Integer.MAX_VALUE;
          for (Map.Entry<String, ExceptionThrownRule> entry : exceptionThrownRuleMap.entrySet()) {
              int depth = getMatchedDepth(entry.getKey(), ex);
              if (depth >= 0 && depth < deepest) {
                  deepest = depth;
                  exceptionThrownRule = entry.getValue();
              }
          }
          return (exceptionThrownRule != null ? exceptionThrownRule : defaultExceptionThrownRule);
      }
docs: Gets the exception thrown rule as specified exception.
  
  @param ex the exception
  @return the exception thrown rule