public List<ThreadStack> getStacks(BufferedReader reader) throws IOException {
    List<ThreadStack> result = new LinkedList<>();
    ThreadStack lastStack = null;
    ArrayList breadcrumbs = new ArrayList(4);
    do {
      String line = null;
      // find the start of the stack
      do {
        reader.mark(100000);
        if ((line = reader.readLine()) == null) {
          break;
        }
        if (line.startsWith(CliStrings.STACK_TRACE_FOR_MEMBER)) {
          reader.reset();
          Collections.sort(result);
          return result;
        }
        if (line.length() > 0 && line.charAt(0) == '"') {
          break;
        }
        if (lastStack != null) {
          if (line.length() == 0 || line.charAt(0) == '\t') {
            lastStack.add(line);
          }
        }
      } while (true);
      // cache the first two lines and examine the third to see if it starts with a tab and "at "
      String firstLine = line;
      String secondLine = null;
      breadcrumbs.clear();
      do {
        line = reader.readLine();
        if (line == null) {
          Collections.sort(result);
          return result;
        }
        if (line.startsWith("\t/")) {
          breadcrumbs.add(line);
          continue;
        } else {
          break;
        }
      } while (true);
      secondLine = line;
      line = reader.readLine();
      if (line == null) {
        Collections.sort(result);
        return result;
      }

      lastStack = new ThreadStack(firstLine, secondLine, line, reader);
      lastStack.addBreadcrumbs(breadcrumbs);
      if (DEBUG) {
        if (breadcrumbs.size() > 0) {
          System.out.println(
              "added " + breadcrumbs.size() + " breadcrumbs to " + lastStack.getThreadName());
        }
        System.out.println("examining thread " + lastStack.getThreadName());
      }
      if (!isExpectedStack(lastStack)) {
        result.add(lastStack);
      }
      if (lastStack.getThreadName().equals("VM Thread")) {
        Collections.sort(result);
        return result;
      }
    } while (true);
  }
parses each stack trace and returns any that are unexpected
geode-core/src/main/java/org/apache/geode/internal/util/PluckStacks.java