### Question:
AggregatingAlertProvider implements AlertProvider, AlertSourceAggregator, AlertNotifyReceiver, Consumer<Event<Alert>> { @Override public ID resolve(Serializable value) { if (value instanceof String) { return SourceAlertID.create((String) value, this.sources, this.managers); } else if (value instanceof SourceAlertID) { return (SourceAlertID) value; } else { throw new IllegalArgumentException("Unrecognized alert ID format: " + value); } } AggregatingAlertProvider(); void setAvailableAlertsExecutor(Executor availableAlertsExecutor); @Override void accept(Event<Alert> event); @Override AlertCriteria criteria(); @Override ID resolve(Serializable value); @Override ID resolve(ID id, AlertSource source); @Override void addListener(AlertListener listener); @Override void addResponder(AlertResponder responder); @Override boolean addAlertSource(AlertSource src); @Override boolean removeAlertSource(AlertSource src); @Override boolean addAlertManager(AlertManager mgr); @Override boolean removeAlertManager(AlertManager mgr); @Override Optional<Alert> getAlert(ID id); Optional<Alert> getAlertAsServiceAccount(ID id); @Override Iterator<? extends Alert> getAlerts(AlertCriteria criteria); Iterator<? extends AlertSummary> getAlertsSummary(AlertCriteria criteria); @Override Iterator<? extends Alert> getAlertsAfter(DateTime time); @Override Iterator<? extends Alert> getAlertsModifiedAfter(DateTime time); @Override Iterator<? extends Alert> getAlertsBefore(DateTime time); @Override void respondTo(ID id, AlertResponder responder); @Override void alertsAvailable(int count); Optional<Alert> getAlert(Alert.ID id, AlertSource src, boolean asServiceAccount); Alert unwrapAlert(Alert proxy);  }### Answer:
@Test public void testResolve() { TestAlert mgrAlert = new TestAlert(this.manager); TestAlert srcAlert = new TestAlert(this.source); SourceAlertID mgrId = new SourceAlertID(mgrAlert.getId(), this.manager); SourceAlertID srcId = new SourceAlertID(srcAlert.getId(), this.source); String mgrIdStr = mgrId.toString(); String srcIdStr = srcId.toString(); this.provider.addAlertSource(this.source); this.provider.addAlertManager(this.manager); when(this.source.resolve(any(TestID.class))).thenReturn(srcAlert.getId()); when(this.manager.resolve(any(TestID.class))).thenReturn(mgrAlert.getId()); when(this.source.resolve(any(String.class))).thenReturn(srcAlert.getId()); when(this.manager.resolve(any(String.class))).thenReturn(mgrAlert.getId()); Alert.ID mgrObjResolved = this.provider.resolve(mgrId); Alert.ID srcObjResolved = this.provider.resolve(srcId); Alert.ID mgrStrResolved = this.provider.resolve(mgrIdStr); Alert.ID srcStrResolved = this.provider.resolve(srcIdStr); assertThat(mgrObjResolved).isInstanceOf(SourceAlertID.class).isEqualTo(mgrId).isEqualTo(mgrStrResolved); assertThat(srcObjResolved).isInstanceOf(SourceAlertID.class).isEqualTo(srcId).isEqualTo(srcStrResolved); }