@Test
  @Verifies(
      value = "should return program enrollment after specified date",
      method = "getClosestFutureProgramEnrollment(Patient,Program,Date)")
  public void shouldReturnPatientProgramWithEnrollmentAfterSpecifiedDate() throws Exception {
    // load this data set so that we get the additional patient program created in this data case
    executeDataSet(
        XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REGRESSION_TEST_DATASET));

    ProgramWorkflowService pws = Context.getProgramWorkflowService();
    Patient patient = Context.getPatientService().getPatient(2);
    Program program = pws.getProgram(1);

    Calendar cal = Calendar.getInstance();
    cal.set(2001, 6, 31);
    Date date = cal.getTime();

    PatientProgram pp = HtmlFormEntryUtil.getClosestFutureProgramEnrollment(patient, program, date);
    Assert.assertEquals("32296060-03aa-102d-b0e3-001ec94a0cc5", pp.getUuid());

    // now, if we roll the date back a year earlier, it should get the earlier of the two programs
    // for this patient
    cal.set(2000, 6, 31);
    date = cal.getTime();

    pp = HtmlFormEntryUtil.getClosestFutureProgramEnrollment(patient, program, date);
    Assert.assertEquals("32596060-03aa-102d-b0e3-001ec94a0cc5", pp.getUuid());
  }