class LHSGeneratorContextFactory {

    public int getMaximumPatternDepth() {
        int depth = 0;
        for (LHSGeneratorContext gctx : contexts) {
            if (Objects.nonNull(gctx.getPattern())) {
                depth = Math.max(depth,
                                 gctx.getDepth());
            }
        }
        return depth;
    }

}