### Question:
DeleteClinician implements Runnable { @Override public void run() { Optional<Clinician> clinician = manager.getClinicianByStaffId(id); if (!clinician.isPresent()) { outputStream.println("No clinician exists with that user ID"); } else if (clinician.get().getStaffId() == manager.getDefaultClinician().getStaffId()) { outputStream.println("Default clinician cannot be deleted"); } else if (!yes) { outputStream.println( String.format("Removing clinician: %s, with staff id: %s,\nto proceed please rerun the command " + "with the -y flag", clinician.get().getFullName(), clinician.get().getStaffId())); } else { Action action = new DeleteClinicianAction(clinician.get(), manager); outputStream.println(invoker.execute(action)); outputStream.println("This removal will only be permanent once the 'save' command is used"); } } DeleteClinician(PrintStream outputStream, ActionInvoker invoker);  DeleteClinician(ClinicianManager manager, ActionInvoker invoker); @Override void run();  }### Answer:
@Test public void ValidDeleteWithYesFlagTest() { doNothing().when(spyClinicianManager).removeClinician(any()); String[] inputs = {"-s", Integer.toString(staffId), "-y"}; CommandLine.run(spyDeleteClinician, System.out, inputs); Mockito.verify(spyClinicianManager, times(1)).removeClinician(any()); }
@Test public void ValidDeleteWithoutYesFlagTest() { doNothing().when(spyClinicianManager).removeClinician(any()); String[] inputs = {"-s", Integer.toString(staffId)}; CommandLine.run(spyDeleteClinician, System.out, inputs); Mockito.verify(spyClinicianManager, times(0)).removeClinician(any()); }
@Test public void testDeleteDefault() { doNothing().when(spyClinicianManager).removeClinician(any()); String[] inputs = {"-s", "0"}; CommandLine.run(spyDeleteClinician, System.out, inputs); Mockito.verify(spyClinicianManager, times(0)).removeClinician(any()); }
@Test public void testDeleteInvalidId() { doNothing().when(spyClinicianManager).removeClinician(any()); String[] inputs = {"-s", "5"}; CommandLine.run(spyDeleteClinician, System.out, inputs); Mockito.verify(spyClinicianManager, times(0)).removeClinician(any()); }
@Test public void testDeleteIdNotInt() { doNothing().when(spyClinicianManager).removeClinician(any()); String[] inputs = {"-s", "q"}; CommandLine.run(spyDeleteClinician, System.out, inputs); Mockito.verify(spyClinicianManager, times(0)).removeClinician(any()); }
@Test public void testDeleteInvalidOption() { doNothing().when(spyClinicianManager).removeClinician(any()); String[] inputs = {"-s", "0", "--invalidOption", "0"}; CommandLine.run(spyDeleteClinician, System.out, inputs); Mockito.verify(spyClinicianManager, times(0)).removeClinician(any()); }