If an {@link AccessibilityEvent} is marshaled/unmarshaled correctly
AccessibilityEvent first =
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED);
assertNotNull(first);
first.setClassName(CLASS_NAME);
first.setPackageName(PACKAGE_NAME);
first.getText().add(TEXT);
first.setFromIndex(FROM_INDEX);
first.setAddedCount(ADDED_COUNT);
first.setRemovedCount(REMOVED_COUNT);
first.setChecked(true);
first.setContentDescription(CONTENT_DESCRIPTION);
first.setItemCount(ITEM_COUNT);
first.setCurrentItemIndex(CURRENT_ITEM_INDEX);
first.setEnabled(true);
first.setPassword(true);
first.recycle();
assertNotNull(first);
assertNull(first.getClassName());
assertNull(first.getPackageName());
assertEquals(0, first.getText().size());
assertFalse(first.isChecked());
assertNull(first.getContentDescription());
assertEquals(-1, first.getItemCount());
assertEquals(AccessibilityEvent.INVALID_POSITION, first.getCurrentItemIndex());
assertFalse(first.isEnabled());
assertFalse(first.isPassword());
assertEquals(-1, first.getFromIndex());
assertEquals(-1, first.getAddedCount());
assertEquals(-1, first.getRemovedCount());
// get another event from the pool (this must be the recycled first)
AccessibilityEvent second = AccessibilityEvent.obtain();
assertEquals(first, second);