@@ -0,0 +1,1735 @@
+package net.grandcentrix.thirtyinch.test;%0A%0Aimport android.support.annotation.NonNull;%0A%0Aimport net.grandcentrix.thirtyinch.TiPresenter;%0Aimport net.grandcentrix.thirtyinch.TiView;%0A%0Aimport java.util.concurrent.Executor;%0A%0Apublic class TiTestPresenter%3CV extends TiView%3E %7B%0A%0A    private TiPresenter%3CV%3E mPresenter;%0A%0A    public TiTestPresenter(final TiPresenter%3CV%3E presenter) %7B%0A        mPresenter = presenter;%0A    %7D%0A%0A    /**%0A     * attaches the new view and takes care for removing the old view when one is attached%0A     */%0A    public void attachView(final V view) %7B%0A        detachView();%0A%0A        mPresenter.setUiThreadExecutor(new Executor() %7B%0A            @Override%0A            public void execute(@NonNull final Runnable action) %7B%0A                action.run();%0A            %7D%0A        %7D);%0A        mPresenter.attachView(view);%0A    %7D%0A%0A    public void create() %7B%0A        mPresenter.create();%0A    %7D%0A%0A    public void destroy() %7B%0A        detachView();%0A        mPresenter.destroy();%0A    %7D%0A%0A    /**%0A     * moves the presenter into state %7B@link TiPresenter.State#VIEW_DETACHED%7D%0A     * from every state%0A     */%0A    public void detachView() %7B%0A        final TiPresenter.State state = mPresenter.getState();%0A        switch (state) %7B%0A            case INITIALIZED:%0A                mPresenter.create();%0A                break;%0A            case VIEW_DETACHED:%0A                // already there%0A                break;%0A            case VIEW_ATTACHED:%0A                mPresenter.detachView();%0A                mPresenter.setUiThreadExecutor(null);%0A                break;%0A            case DESTROYED:%0A                throw new IllegalStateException(%0A                        %22Presenter is already destroyed, further lifecycle changes aren't allowed%22);%0A        %7D%0A    %7D%0A%7D

Create TiTestPresenter