### Question:
SectionManager { public void updateDirtyIndicator(final Section<T> section) { section.setDirty(isDirty(section)); } @Inject  SectionManager(final MenuItemsListPresenter<T> menuItemsListPresenter,
                          final Promises promises,
                          final Elemental2DomUtil elemental2DomUtil); void init(final List<Section<T>> sections,
                     final HTMLElement menuItemsContainer,
                     final HTMLElement contentContainer); Promise<Void> goTo(final Section<T> section); Promise<Void> goToFirstAvailable(); Promise<Void> goToCurrentSection(); Promise<Object> validateAll(); void remove(final Section<T> section); Promise<Void> resetAllDirtyIndicators(); void resetDirtyIndicator(final Section<T> section); void updateDirtyIndicator(final Section<T> section); boolean manages(final Section<T> section); boolean isEmpty(); List<Section<T>> getSections(); Section<T> getCurrentSection(); boolean hasDirtySections();  }### Answer:
@Test public void testUpdateDirtyIndicatorNonexistentSection() { final Section<ProjectScreenModel> section = newMockedSection(); sectionManager.originalHashCodes = new HashMap<>(); sectionManager.updateDirtyIndicator(section); verify(section).setDirty(false); }
@Test public void testUpdateDirtyIndicatorExistentDirtySection() { final Section<ProjectScreenModel> section = newMockedSection(); doReturn(42).when(section).currentHashCode(); sectionManager.sections = new ArrayList<>(Arrays.asList(section)); sectionManager.originalHashCodes = new HashMap<>(); sectionManager.originalHashCodes.put(section, 32); sectionManager.updateDirtyIndicator(section); verify(section).setDirty(true); }
@Test public void testUpdateDirtyIndicatorExistentNotDirtySection() { final Section<ProjectScreenModel> section = newMockedSection(); doReturn(42).when(section).currentHashCode(); sectionManager.sections = new ArrayList<>(Arrays.asList(section)); sectionManager.originalHashCodes = new HashMap<>(); sectionManager.originalHashCodes.put(section, 42); sectionManager.updateDirtyIndicator(section); verify(section).setDirty(false); }