code: public static StackTraceElement getCaller(int deep, boolean ignoreSameClass) {
      // index 0 is Thread.getStackTrace
      // index 1 is ReflectUtil.getCallerClassName
      StackTraceElement[] stElements = Thread.currentThread().getStackTrace();
      StackTraceElement currentStack = stElements[1];
      int found = deep + 1;
      for (int i = 1; i < stElements.length; i++) {
        StackTraceElement nextStack = stElements[i];
        if (nextStack.getClassName().equals(ReflectUtil.class.getName())) {
          continue;
        }
        if (!ignoreSameClass || !currentStack.getClassName().equals(nextStack.getClassName())) {
          currentStack = nextStack;
          found--;
        }
        if (found == 0) {
          return currentStack;
        }
      }
      throw new IllegalArgumentException("Stack don't have such deep.");
    }
docs: Get caller stack info.
  
  @param deep Deep to search the caller class.If deep is 0, it returns the class who calls this
  method.
  @param ignoreSameClass If it is true, calling in same class will be ignored.