public ImmutableContextSet getPotentialContexts() {
        ImmutableContextSet.Builder builder = new ImmutableContextSetImpl.BuilderImpl();

        for (ContextCalculator<? super S> calculator : this.calculators.calculators()) {
            ContextSet potentialContexts;
            try {
                potentialContexts = calculator.estimatePotentialContexts();
            } catch (Throwable e) {
                this.plugin.getLogger().warn("An exception was thrown by " + getCalculatorClass(calculator) + " whilst estimating potential contexts", e);
                continue;
            }
            builder.addAll(potentialContexts);
        }

        return builder.build();
    }
Base implementation of {@link ContextManager}.

@param <S> the subject type
@param <P> the player type
common/src/main/java/me/lucko/luckperms/common/context/manager/ContextManager.java