### Question:
SwipeDismissFrameLayout extends SwipeDismissLayout { public void removeCallback(Callback callback) { if (callback == null) { throw new NullPointerException("removeCallback called with null callback"); } if (!mCallbacks.remove(callback)) { throw new IllegalStateException("removeCallback called with nonexistent callback"); } } SwipeDismissFrameLayout(Context context);  SwipeDismissFrameLayout(Context context, AttributeSet attrs);  SwipeDismissFrameLayout(Context context, AttributeSet attrs, int defStyle);  SwipeDismissFrameLayout(Context context, AttributeSet attrs, int defStyle,
            int defStyleRes); void addCallback(Callback callback); void removeCallback(Callback callback);  }### Answer:
@Test @SmallTest public void testAddRemoveCallback() { setUpSimpleLayout(); Activity activity = activityRule.getActivity(); SwipeDismissFrameLayout testLayout = activity.findViewById(R.id.swipe_dismiss_root); testLayout.removeCallback(mDismissCallback); onView(withId(R.id.swipe_dismiss_root)).perform(swipeRight()); assertNotHidden(R.id.swipe_dismiss_root); }