### Question:
ModelServiceImpl implements ModelService { @Override public <T extends Task> List<T> getTasksBy(Project project, ModelType processModelType, @NonNull Class<T> clazz) { Assert.notNull(clazz, "Class task type it must not be null"); return getProcessesBy(project, processModelType) .stream() .map(Process::getFlowElements) .flatMap(Collection::stream) .filter(clazz::isInstance) .map(clazz::cast) .collect(Collectors.toList()); } @Autowired  ModelServiceImpl(ModelRepository modelRepository,
                            ModelTypeService modelTypeService,
                            ModelContentService modelContentService,
                            ModelExtensionsService modelExtensionsService,
                            JsonConverter<Model> jsonConverter,
                            ProcessModelContentConverter processModelContentConverter); @Override List<Model> getAllModels(Project project); @Override Page<Model> getModels(Project project,
                                 ModelType modelType,
                                 Pageable pageable); @Override Model buildModel(String type,
                            String name); @Override Model createModel(Project project,
                             Model model); @Override Model updateModel(Model modelToBeUpdated,
                             Model newModel); @Override void deleteModel(Model model); @Override Optional<Model> findModelById(String modelId); @Override Optional<FileContent> getModelExtensionsFileContent(Model model); @Override void cleanModelIdList(); @Override Optional<FileContent> getModelDiagramFile(String modelId); @Override String getExtensionsFilename(Model model); @Override FileContent getModelContentFile(Model model); @Override FileContent exportModel(Model model); @Override Model updateModelContent(Model modelToBeUpdate,
                                    FileContent fileContent); @Override FileContent overrideModelContentId(Model model,
                                              FileContent fileContent); @Override Optional<ModelContent> createModelContentFromModel(Model model,
                                                              FileContent fileContent); @Override Model importSingleModel(Project project,
                                   ModelType modelType,
                                   FileContent fileContent); @Override Model importModel(Project project,
                             ModelType modelType,
                             FileContent fileContent); @Override Model importModelFromContent(Project project,
                                        ModelType modelType,
                                        FileContent fileContent); @Override List<T> getTasksBy(Project project, ModelType processModelType, @NonNull Class<T> clazz); @Override List<Process> getProcessesBy(Project project, ModelType type); @Override Model convertContentToModel(ModelType modelType,
                                       FileContent fileContent); @Override Model createModelFromContent(ModelType modelType,
                                        FileContent fileContent); @Override Optional<String> contentFilenameToModelName(String filename,
                                                       ModelType modelType); @Override void validateModelContent(Model model,
                                     ValidationContext validationContext); @Override void validateModelContent(Model model,
                                     FileContent fileContent); @Override void validateModelContent(Model model,
                                     FileContent fileContent,
                                     ValidationContext validationContext); @Override void validateModelExtensions(Model model,
                                        ValidationContext validationContext); @Override void validateModelExtensions(Model model,
                                        FileContent fileContent); @Override void validateModelExtensions(Model model,
                                        FileContent fileContent,
                                        ValidationContext validationContext);  }### Answer:
@Test public void should_returnException_when_classTypeIsNotSpecified() { ProcessModelType modelType = new ProcessModelType(); assertThatThrownBy(() -> modelService.getTasksBy(projectOne, modelType, null)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Class task type it must not be null"); }