@Test
public void rootNodeIsSourceAncestor() {

  when(sourceMock.getParent()).thenReturn(parentMock);
  when(parentMock.getParent()).thenReturn(grandparentMock);
  AccessibilityNodeInfo rootNode = testSubject.getRootNodeFromSource(sourceMock);
  Assert.assertEquals(rootNode, grandparentMock);
}