### Question:
DBAlertManager extends DBManager<Alert> implements AlertManager { @Override public final void resolveAlerts(final List<Alert> alerts) throws AlertManagerException { resolveAlerts(alerts, null); } DBAlertManager(final SessionFactory factory); @Override final Alert saveAlert(final Alert alert); @Override final List<Alert> updateAlerts(final List<Alert> alerts); @Override final List<Alert> getAlertList(); @Override @SuppressWarnings("checkstyle:parameternumber") final FilteredRecordsList<Alert> getOrderedAlertList(
            final String reportId, final String columnToOrder, final boolean ascending,
            final int firstResult, final int maxResults, final String search,
            final AlertListType listType,
            final Map<String, Boolean> searchableColumns, final Date beginDate, final Date endDate); @Override final Alert getAlert(final UUID id); @Override final List<Alert> getAlertsForPolicy(final Policy policy); @Override final List<Alert> getAlertsForBaseline(final Baseline baseline); @Override final long getTotalAlertsForBaseline(final Baseline baseline); @Override List<Alert> getTrustAlerts(final Device device, final Report integrityReport,
                                      final Criterion optionalCriterion); @Override final int getTrustAlertCount(final Device device, final Report integrityReport,
                                    final Criterion optionalCriterion); @Override final void resolveAlerts(final List<Alert> alerts); @Override final void resolveAlerts(final List<Alert> alerts, final String description); final int countUnresolvedAlerts(final Device device); final int countUnresolvedAlerts(final Device device, final AlertSource source); final int countUnresolvedDevices(final DeviceGroup deviceGroup);  }### Answer:
@Test public void testResolveAlerts() throws AlertManagerException { final AlertManager mgr = new DBAlertManager(sessionFactory); final String[] details = {"AlertOne", "AlertTwo", "AlertThree"}; final Alert[] expectedAlerts = new Alert[details.length]; for (int i = 0; i < details.length; ++i) { expectedAlerts[i] = createAlert(mgr, details[i]); Assert.assertEquals(expectedAlerts[i].isArchived(), false); } mgr.resolveAlerts(Arrays.asList(expectedAlerts)); Alert alertOne = mgr.getAlert(expectedAlerts[0].getId()); Alert alertTwo = mgr.getAlert(expectedAlerts[1].getId()); Alert alertThree = mgr.getAlert(expectedAlerts[2].getId()); Assert.assertTrue(alertOne.isArchived()); Assert.assertTrue(alertTwo.isArchived()); Assert.assertTrue(alertThree.isArchived()); }
@Test(expectedExceptions = NullPointerException.class) public void testResolveAlertsNull() throws AlertManagerException { final AlertManager mgr = new DBAlertManager(sessionFactory); List<Alert> expectedAlerts = null; mgr.resolveAlerts(expectedAlerts); }