### Question:
ModelAttachmentService extends SingleAttachmentService implements ISingleAttachmentService { protected void removeAttachmentInfoFromMaps(@NonNull final ModelRepository modelRepository, @NonNull final String mongoId) { final List<Model> models = modelRepository.findAllByAttachmentMongoId(mongoId); models.stream().forEach(model -> { model.setAttachmentFileName(null); model.setAttachmentMongoId(null); }); modelRepository.save(models); } ModelAttachmentService(final FileRepository fileRepository,
                                  @NonNull final ModelRepository modelRepository); void deleteFile(@NonNull final String fileId);  }### Answer:
@Test public void shouldRemoveAttachmentInfoFromModel_SetNullAsMongoId() { tested.removeAttachmentInfoFromMaps(modelRepository, MONGO_ID); models.forEach(map -> Assert.assertNull(map.getAttachmentMongoId())); }
@Test public void shouldRemoveAttachmentInfoFromModel_SetNullAsFileName() { tested.removeAttachmentInfoFromMaps(modelRepository, MONGO_ID); models.forEach(map -> Assert.assertNull(map.getAttachmentFileName())); }
@Test public void shouldNotRemoveAttachmentInfoFromModel() { tested.removeAttachmentInfoFromMaps(modelRepository, "DIFFERENT_MONGO_ID"); models.forEach(map -> Assert.assertNotNull(map.getAttachmentFileName())); models.forEach(map -> Assert.assertNotNull(map.getAttachmentMongoId())); }