code: public void enableSimpleSwipeUndo() {
          if (mSwipeUndoAdapter == null) {
              throw new IllegalStateException("enableSimpleSwipeUndo requires a SwipeUndoAdapter to be set as an adapter");
          }
  
          mSwipeTouchListener = new SwipeUndoTouchListener(new DynamicListViewWrapper(this), mSwipeUndoAdapter.getUndoCallback());
          mSwipeUndoAdapter.setSwipeUndoTouchListener((SwipeUndoTouchListener) mSwipeTouchListener);
      }
docs: Enables swipe to dismiss with contextual undo for this {@code DynamicListView}.
  This method requires that a {@link com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.undo.SwipeUndoAdapter} has been set.
  It is allowed to have the {@code SwipeUndoAdapter} wrapped in a {@link com.nhaarman.listviewanimations.BaseAdapterDecorator}.
  
  @throws java.lang.IllegalStateException if the adapter that was set does not extend {@code SwipeUndoAdapter}.