### Question:
Doctor extends Profession { public void diagnosed(Patient patient, String disease, int duration, String treatment) { patient.diagnose = new Diagnose(disease, duration, treatment); } Doctor(String name); String threat(Patient patient); Diagnose heal(Patient patient); void diagnosed(Patient patient, String disease, int duration, String treatment);  }### Answer:
@Test public void ifDocDiagnosedPitThenPitDiagnosWasDiagnosed() { doc.diagnosed(pit, "plague", 30, "nothing"); String result = pit.diagnose.disease + " " + pit.diagnose.duration + " " + pit.diagnose.treatment; String expect = "plague 30 nothing"; assertThat(result, is(expect)); }