### Question:
NucleoConsole { public void setTime(Date date) { String timeStr = SET_TIME_FORMAT.format(date); String command = String.format(Locale.getDefault(),SET_TIME_COMMAND_FORMAT,timeStr); mConsole.write(command); } NucleoConsole(Debug console); void setName(String newName); void setTime(Date date); void setDate(Date date); void setDateAndTime(Date date);  }### Answer:
@Test public void canSetTheTime(){ Date date = new GregorianCalendar(2001,01,03,04,05,06).getTime(); mNucleo.setTime(date); verify(mConsole).write("setTime 04:05:06\n"); }
@Test public void setTimeCommandIsSmallerThan20byte(){ Date date = new GregorianCalendar(2001,01,03,04,05,06).getTime(); mNucleo.setTime(date); ArgumentCaptor<String> commandCapture = ArgumentCaptor.forClass(String.class); verify(mConsole).write(commandCapture.capture()); Assert.assertTrue(commandCapture.getValue().length()<=20); }