@Test
public void testGetConflictMedicationsFromComplexTherapy()
{

  final ConstantComplexTherapyDto therapy = new ConstantComplexTherapyDto();
  final MedicationDto medication1 = new MedicationDto();
  medication1.setId(1L);
  medication1.setName("medication1");
  final InfusionIngredientDto ingredient1 = new InfusionIngredientDto();
  ingredient1.setMedication(medication1);
  therapy.getIngredientsList().add(ingredient1);
  final MedicationDto medication2 = new MedicationDto();
  medication2.setId(2L);
  medication2.setName("medication2");
  therapy.getMedications().add(medication2);
  final InfusionIngredientDto ingredient2 = new InfusionIngredientDto();
  ingredient2.setMedication(medication2);
  therapy.getIngredientsList().add(ingredient2);
  final MedicationDto medication3 = new MedicationDto();
  medication3.setId(3L);
  medication3.setName("medication3");
  therapy.getMedications().add(medication3);
  final InfusionIngredientDto ingredient3 = new InfusionIngredientDto();
  ingredient3.setMedication(medication3);
  therapy.getIngredientsList().add(ingredient3);
  final MedicationDto medication4 = new MedicationDto();
  medication4.setId(4L);
  medication4.setName("medication4");
  therapy.getMedications().add(medication4);
  final InfusionIngredientDto ingredient4 = new InfusionIngredientDto();
  ingredient4.setMedication(medication4);
  therapy.getIngredientsList().add(ingredient4);
  final List<MedicationRouteDto> routes = new ArrayList<>();
  therapy.setRoutes(routes);
  final MedicationRouteDto route1 = new MedicationRouteDto();
  route1.setId(1L);
  route1.setName("route1");
  routes.add(route1);
  final MedicationRouteDto route2 = new MedicationRouteDto();
  route2.setId(2L);
  route2.setName("route2");
  routes.add(route2);
  final MedicationRouteDto route3 = new MedicationRouteDto();
  route3.setId(3L);
  route3.setName("route3");
  routes.add(route3);
  final Set<Long> medicationIds = new HashSet<>();
  medicationIds.add(1L);
  medicationIds.add(2L);
  medicationIds.add(4L);
  final List<NamedExternalDto> conflictMedicationIds = mentalHealthAdditionalWarningsProvider.getConflictMedications(
      therapy,
      new MentalHealthAllowedMedicationsDo(HashMultimap.create(), medicationIds));
  Assert.assertEquals(1, conflictMedicationIds.size());
  Assert.assertTrue(conflictMedicationIds.contains(new NamedExternalDto("3", "medication3")));
}