private static @NotNull Optional<Statement> findNestedLastStatement(@NotNull PatternContainer patternContainer) {
      return Optional.of(patternContainer)
        .map(c -> c.patternsByStatement)
        .filter(patterns -> patterns.size() == 1)
        .map(patterns -> patterns.keySet().iterator().next())
        .map(p -> {
          if (p.getStats() != null &&
              p.getStats().size() >= 2 &&
              p.getStats().get(p.getStats().size() - 2) instanceof SwitchStatement) {
            return p.getStats().get(p.getStats().size() - 1);
          }
          else {
            return null;
          }
        })
        .filter(t -> t instanceof BasicBlockStatement basicBlockStatement &&
                     basicBlockStatement.getExprents() != null);
    }
private static @NotNull Optional<Statement> findNestedLastStatement(@NotNull PatternContainer patternContainer)