class ProblemTransformer {

    public List<ProblemDTO> toDtos(Collection<Problem> problems) {
        if (null == problems) {
            return new ArrayList<>();
        }
        return problems.stream()
                .map(this::toDto)
                .collect(Collectors.toList());
    }

}