int[] totalArray = new int[solved.size()];
for (int i = 0; i < solvedArray.length; ++i) {
solvedArray[i] = solved.get(i);
totalArray[i] = total.get(i);
}
ProblemsetRankList r = new ProblemsetRankList(offset, count);
r.setUsers(users.toArray(new UserProfile[0]));
r.setSolved(solvedArray);
r.setTotal(totalArray);
return r;
} catch (SQLException e) {
throw new PersistenceException("Failed to get the rank list", e);
} finally {
Database.dispose(conn);