@LargeTest
 public void testObjectContract() throws Exception {
   final long startTimeMillis = SystemClock.uptimeMillis();
   try {
     // find a view and make sure it is not focused
     AccessibilityNodeInfo button =
         mUiTestAutomationBridge.findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.button5);
     assertNotNull(button);
     AccessibilityNodeInfo parent = button.getParent();
     final int childCount = parent.getChildCount();
     for (int i = 0; i < childCount; i++) {
       AccessibilityNodeInfo child = parent.getChild(i);
       assertNotNull(child);
       if (child.equals(button)) {
         assertEquals(
             "Equal objects must have same hasCode.", button.hashCode(), child.hashCode());
         return;
       }
     }
     fail("Parent's children do not have the info whose parent is the parent.");
   } finally {
     if (DEBUG) {
       final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis;
       Log.i(LOG_TAG, "testObjectContract: " + elapsedTimeMillis + "ms");
     }
   }
 }
 /**
  * Takes a list of {@code AccessibilityCheckResult}s and returns a list with only results
  * pertaining to the given {@code AccessibilityNodeInfo}.
  *
  * @param results a list of {@code AccessibilityCheckResult}s
  * @param info the {@code AccessibilityNodeInfo} to get results for
  * @return a list of {@code AccessibilityCheckResult}s pertaining to the given {@code
  *     AccessibilityNodeInfo}.
  */
 public static List<AccessibilityInfoCheckResult> getResultsForInfo(
     Iterable<AccessibilityInfoCheckResult> results, AccessibilityNodeInfo info) {
   List<AccessibilityInfoCheckResult> resultsForInfo =
       new ArrayList<AccessibilityInfoCheckResult>();
   for (AccessibilityInfoCheckResult result : results) {
     if (info.equals(result.getInfo())) {
       resultsForInfo.add(result);
     }
   }
   return resultsForInfo;
 }