### Question:
AsyncTaskRep { public Task save(Task task) { Jedis jedis = jedisPool.getResource(); Transaction transaction = jedis.multi(); boolean discard = true; try { for (Job job : task.getJobs()) { job.setParentTaskId(task.getTaskId()); jobDao.save(job, transaction); } taskDao.save(task, transaction); transaction.exec(); discard = false; } finally { if (discard) { transaction.discard(); } jedisPool.returnResource(jedis); } return task; }  Task save(Task task); Job save(Job job); void delete(Task task); List<Task> findTasksByOwnerId(final TaskOwnerType type, final String ownerId); Task findTask(final String taskId); Task findTaskByJobId(final String jobId); Job findJob(final String jobId);  }### Answer:
@Test public void test_saveTaskWithJobs() { Task task = taskGenerator.createUniqueInstance(); Job j0 = jobGenerator.createUniqueInstance(); Job j1 = jobGenerator.createUniqueInstance(); Job j2 = jobGenerator.createUniqueInstance(); task.getJobs().add(j0); task.getJobs().add(j1); task.getJobs().add(j2); task = repo.save(task); assertNotNull(task); assertEquals(task.getJobs().size(), 3); task = repo.save(task); assertEquals(task.getJobs().size(), 3); }