### Question:
JamonRepository implements Serializable, MonitoringRepository { public Monitor findMonitorByLabel(String monitorLabel) { if (monitorLabel == null) { throw new IllegalArgumentException("monitorLabel is null"); } List<Monitor> monitors = find(new MonitorLabelSpecification(monitorLabel)); if (monitors.size() > 1) { throw new IllegalStateException( format("More than one monitor with label '%s' found", monitorLabel)); } return monitors.isEmpty() ? null : monitors.get(0); } JamonRepository(); int count(); static void clear(); Monitor findMonitorByLabel(String monitorLabel); List<Monitor> find(MonitorSpecification specification);  }### Answer:
@Test public void shouldFailIfTryingToFindMonitorWithNullLabel() { assertThrows(IllegalArgumentException.class, () -> { jamonRepository.findMonitorByLabel(null); }); }
@Test public void shouldReturnNullIfNoMonitorIsFoundForACertainLabel() { startThisManyMonitors(1); assertNull(jamonRepository.findMonitorByLabel("non existing label")); }
@Test public void shouldReturnMonitorWithGivenLabel() { startThisManyMonitors(2); Monitor actual = jamonRepository.findMonitorByLabel(MONITOR_PREFIX + "1"); assertNotNull(actual); assertEquals(MONITOR_PREFIX + "1", actual.getLabel()); }