class DefaultProblemCollector implements ProblemCollector {

    private final List<Problem> problems;

    private String source;

    DefaultProblemCollector(List<Problem> problems) {
        this.problems = (problems != null) ? problems : new ArrayList<>();
    }

    @Override
    public List<Problem> getProblems() {
        return problems;
    }

    @Override
    public void setSource(String source) {
        this.source = source;
    }

    @Override
    public void add(Problem.Severity severity, String message, int line, int column, Exception cause) {<FILL_FUNCTION_BODY>}
}

        Problem problem = new DefaultProblem(message, severity, source, line, column, cause);

        problems.add(problem);
    
<no_super_class>