### Question:
ResourceChangeDetector implements ChangeDetector { public synchronized void resetSnapshots() { _newSnapshot = new ResourceChangeSnapshot(); clearCachedComputation(); } ResourceChangeDetector(boolean ignoreNonTopologyChange);  ResourceChangeDetector(); synchronized void updateSnapshots(ResourceControllerDataProvider dataProvider); synchronized void resetSnapshots(); @Override synchronized Collection<HelixConstants.ChangeType> getChangeTypes(); @Override synchronized Collection<String> getChangesByType(HelixConstants.ChangeType changeType); @Override synchronized Collection<String> getAdditionsByType(HelixConstants.ChangeType changeType); @Override synchronized Collection<String> getRemovalsByType(HelixConstants.ChangeType changeType); Map<HelixConstants.ChangeType, Set<String>> getAllChanges();  }### Answer:
@Test(dependsOnMethods = "testIgnoreNonTopologyChanges") public void testResetSnapshots() { HelixClusterVerifier _clusterVerifier = new StrictMatchExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient) .setDeactivatedNodeAwareness(true) .setResources(new HashSet<>(_dataAccessor.getChildNames(_keyBuilder.idealStates()))) .setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME) .build(); Assert.assertTrue(_clusterVerifier.verify()); ResourceChangeDetector changeDetector = new ResourceChangeDetector(); _dataProvider.notifyDataChange(ChangeType.IDEAL_STATE); _dataProvider.refresh(_dataAccessor); changeDetector.updateSnapshots(_dataProvider); Assert.assertEquals( changeDetector.getAdditionsByType(ChangeType.IDEAL_STATE).size() + changeDetector .getChangesByType(ChangeType.IDEAL_STATE).size() + changeDetector .getRemovalsByType(ChangeType.IDEAL_STATE).size(), 1); _dataProvider.notifyDataChange(ChangeType.IDEAL_STATE); _dataProvider.refresh(_dataAccessor); changeDetector.updateSnapshots(_dataProvider); Assert.assertEquals( changeDetector.getAdditionsByType(ChangeType.IDEAL_STATE).size() + changeDetector .getChangesByType(ChangeType.IDEAL_STATE).size() + changeDetector .getRemovalsByType(ChangeType.IDEAL_STATE).size(), 0); changeDetector.resetSnapshots(); _dataProvider.notifyDataChange(ChangeType.IDEAL_STATE); _dataProvider.refresh(_dataAccessor); changeDetector.updateSnapshots(_dataProvider); Assert.assertEquals( changeDetector.getAdditionsByType(ChangeType.IDEAL_STATE).size() + changeDetector .getChangesByType(ChangeType.IDEAL_STATE).size() + changeDetector .getRemovalsByType(ChangeType.IDEAL_STATE).size(), 1); }