public Problem[] getProblemsForUser(Course course, int userId)
      throws CloudCoderAuthenticationException {
    // Make sure user is authenticated
    User user = Database.getInstance().getUserGivenId(userId);

    List<Problem> resultList =
        Database.getInstance().getProblemsInCourse(user, course).getProblemList();
    for (Problem p : resultList) {
      logger.warn(p.getTestname() + " - " + p.getBriefDescription());
    }

    return resultList.toArray(new Problem[resultList.size()]);
  }
  @Override
  public Problem[] getProblems(Course course) throws CloudCoderAuthenticationException {
    // Make sure user is authenticated
    User user =
        ServletUtil.checkClientIsAuthenticated(
            getThreadLocalRequest(), GetCoursesAndProblemsServiceImpl.class);

    List<Problem> resultList =
        Database.getInstance().getProblemsInCourse(user, course).getProblemList();
    for (Problem p : resultList) {
      logger.info(p.getTestname() + " - " + p.getBriefDescription());
    }

    return resultList.toArray(new Problem[resultList.size()]);
  }