EventHelper { public boolean restoreLastSource(AccessibilityNodeInfo previousSource) { return swapper.setIfCurrentlyNull(previousSource); } EventHelper(ThreadSafeSwapper<AccessibilityNodeInfo> swapper); void recordEvent(AccessibilityNodeInfo source); AccessibilityNodeInfo claimLastSource(); boolean restoreLastSource(AccessibilityNodeInfo previousSource);  }
@Test public void restoreLastSourceCallsSetIfCurrentlyNullOnlyOnce() { testSubject.restoreLastSource(mockNodeInfo); verify(mockSwapper, times(1)).setIfCurrentlyNull(mockNodeInfo); }