### Question:
TaskDefinitionService { public Optional<TaskDefinition> findByIdentifier(final String productIdentifier, final String identifier) { return taskDefinitionRepository .findByProductIdAndTaskIdentifier(productIdentifier, identifier) .map(TaskDefinitionMapper::map); } @Autowired  TaskDefinitionService(
          final TaskDefinitionRepository taskDefinitionRepository); List<TaskDefinition> findAllEntities(final String productIdentifier); Optional<TaskDefinition> findByIdentifier(final String productIdentifier, final String identifier);  }### Answer:
@Test public void findByIdentifier() { findByIdentifierTestHelper(true, true); findByIdentifierTestHelper(false, false); }