@Override @Implementation @SuppressWarnings("ReferenceEquality") public boolean equals(Object object) { if (!(object instanceof AccessibilityWindowInfo)) { return false; } final AccessibilityWindowInfo window = (AccessibilityWindowInfo) object; final ShadowAccessibilityWindowInfo otherShadow = Shadow.extract(window); boolean areEqual = (type == otherShadow.getType()); areEqual &= (parent == otherShadow.getParent()); areEqual &= (rootNode == otherShadow.getRoot()); areEqual &= (layer == otherShadow.getLayer()); areEqual &= (id == otherShadow.getId()); areEqual &= (title == otherShadow.getTitle()); areEqual &= (isAccessibilityFocused == otherShadow.isAccessibilityFocused()); areEqual &= (isActive == otherShadow.isActive()); areEqual &= (isFocused == otherShadow.isFocused()); Rect anotherBounds = new Rect(); otherShadow.getBoundsInScreen(anotherBounds); areEqual &= (boundsInScreen.equals(anotherBounds)); return areEqual; }
@Override @Implementation @SuppressWarnings("ReferenceEquality") public boolean equals(Object object) { if (!(object instanceof AccessibilityWindowInfo)) { return false; } final AccessibilityWindowInfo window = (AccessibilityWindowInfo) object; final ShadowAccessibilityWindowInfo otherShadow = Shadow.extract(window); boolean areEqual = (type == otherShadow.getType()); areEqual &= (parent == otherShadow.getParent()); areEqual &= (rootNode == otherShadow.getRoot()); areEqual &= (layer == otherShadow.getLayer()); areEqual &= (id == otherShadow.getId()); areEqual &= (title == otherShadow.getTitle()); areEqual &= (isAccessibilityFocused == otherShadow.isAccessibilityFocused()); areEqual &= (isActive == otherShadow.isActive()); areEqual &= (isFocused == otherShadow.isFocused()); Rect anotherBounds = new Rect(); otherShadow.getBoundsInScreen(anotherBounds); areEqual &= (boundsInScreen.equals(anotherBounds)); return areEqual; }