@Test
public void testAreInstructionsSimilarSimple()
{

  // therapy
  final MedicationOrderComposition composition =
      MedicationsTestUtils.buildTestMedicationOrderComposition("uid1::1", new DateTime(2013, 11, 11, 0, 0, 0), null);
  final MedicationInstructionInstruction instruction =
      MedicationsTestUtils.buildTestMedicationInstruction("MedicationInstructionInstruction 1");
  composition.getMedicationDetail().getMedicationInstruction().add(instruction);
  final OrderActivity orderActivity =
      MedicationsTestUtils.buildTestOrderActivity(
          "Lekadol", 1L, 500.0, "mg", null, null, null, null, 1L, "ORAL", "1", "TBL");
  instruction.getOrder().add(orderActivity);
  final MedicationTimingCluster medicationTiming =
      MedicationsTestUtils.buildMedicationTimingCluster(
          2L, null, null, null, new DateTime(2013, 11, 11, 0, 0, 0), null, null);
  orderActivity.setMedicationTiming(medicationTiming);
  //compare therapy
  final MedicationOrderComposition compareComposition =
      MedicationsTestUtils.buildTestMedicationOrderComposition("uid2::1", new DateTime(2013, 10, 10, 0, 0, 0), null);
  final MedicationInstructionInstruction compareInstruction =
      MedicationsTestUtils.buildTestMedicationInstruction("MedicationInstructionInstruction 1");
  compareComposition.getMedicationDetail().getMedicationInstruction().add(compareInstruction);
  final OrderActivity compareOrderActivity =
      MedicationsTestUtils.buildTestOrderActivity(
          "Daleron", 2L, 500.0, "mg", null, null, null, null, 1L, "ORAL", "1", "TBL");
  compareInstruction.getOrder().add(compareOrderActivity);
  final MedicationTimingCluster compareMedicationTiming =
      MedicationsTestUtils.buildMedicationTimingCluster(
          2L, null, null, null, new DateTime(2013, 10, 10, 0, 0, 0), new DateTime(2013, 11, 11, 0, 0, 0), null);
  compareOrderActivity.setMedicationTiming(compareMedicationTiming);
  //medications data map
  final Map<Long, MedicationDataForTherapyDto> medicationsMap = new HashMap<>();
  final MedicationDataForTherapyDto medicationData1 = new MedicationDataForTherapyDto();
  medicationData1.setGenericName("Paracetamol");
  medicationData1.setCustomGroupName("Group 1");
  medicationData1.setAtcGroupCode("ATC 1");
  medicationsMap.put(1L, medicationData1);
  final MedicationDataForTherapyDto medicationData2 = new MedicationDataForTherapyDto();
  medicationData2.setGenericName("Paracetamol");
  medicationData2.setCustomGroupName("Group 1");
  medicationData2.setAtcGroupCode("ATC 1");
  medicationsMap.put(2L, medicationData2);
  assertTrue(
      medicationsBo.areTherapiesSimilar(
          Pair.of(composition, instruction),
          Pair.of(compareComposition, compareInstruction),
          medicationsMap,
          false)
  );
}