code: @Nullable
      public <P> P getListener(Class<P> type) {
          if (mListener != null) {
              return type.cast(mListener);
          }
          return null;
      }
docs: Gets the listener object that was passed into the Adapter through its constructor and cast
  it to a given type.
  
  @param type the type of the listener
  @return the listener casted to the given type or null if not listener was set into the Adapter.