}
private Task[] testFetchForUserRolesWithCriteria(String userId,
String[] roles, Class taskClass, String subQuery, int size,
boolean optionalMarshalling) throws Exception {
Task[] tasks = new TaskFetcher(em).fetchAvailableTasks(new UserRoles(
userId, roles), taskClass, subQuery);
Assert.assertEquals(size, tasks.length);
if (optionalMarshalling) {
TaskMarshaller marshaller = new TaskMarshaller();