TaskMapper { public static TaskModel transform(TaskEntity taskEntity) { TaskModel taskModel = null; if (taskEntity != null) { taskModel = new TaskModel(taskEntity.getTitle()); taskModel.setId(taskEntity.getId()); taskModel.setDeadline(taskEntity.getDeadline()); taskModel.setTag(taskEntity.getTag()); taskModel.setDeadlineMs(taskEntity.getDeadlineMs()); taskModel.setPriority(TaskPriorityMapper.transform(taskEntity.getPriority())); } return taskModel; }  static TaskModel transform(TaskEntity taskEntity);  }
@Test public void testTransformEntity() { TaskEntity taskEntity = createEntity(); TaskModel taskModel = TaskMapper.transform(taskEntity); assertThat(taskModel, is(instanceOf(TaskModel.class))); assertThat(taskModel.getId(), is(FAKE_TASK_ID)); assertThat(taskModel.getTitle(), is(FAKE_TASK_TITLE)); assertThat(taskModel.getDeadlineMs()).isEqualTo(FAKE_TASK_DEADLINE_MS); assertThat(taskModel.getTag(), is(FAKE_TASK_TAG)); }