code: public static TestMethod getRootMethod(
              TestMethodTable rootMethodTable, StackTraceElement[] currentStackTrace) {
          for (StackTraceElement element : currentStackTrace) {
              List<TestMethod> rootMethods
              = rootMethodTable.getByName(element.getClassName(), element.getMethodName());
              if (rootMethods.size() > 0) {
                  assert rootMethods.size() == 1;
                  return rootMethods.get(0);
              }
          }
          return null;
      }
docs: returns null if not found