@@ -0,0 +1,665 @@
+package org.ccci.gto.android.common.util;%0A%0Aimport android.support.annotation.NonNull;%0A%0Aimport java.lang.ref.Reference;%0Aimport java.lang.ref.WeakReference;%0A%0Apublic final class WeakTask%3CT%3E implements Runnable %7B%0A    private final Reference%3CT%3E mRef;%0A    private final Task%3CT%3E mTask;%0A%0A    public WeakTask(@NonNull final T obj, @NonNull final Task%3CT%3E task) %7B%0A        mRef = new WeakReference%3C%3E(obj);%0A        mTask = task;%0A    %7D%0A%0A    @Override%0A    public void run() %7B%0A        final T obj = mRef.get();%0A        if (obj != null) %7B%0A            mTask.run(obj);%0A        %7D%0A    %7D%0A%0A    @FunctionalInterface%0A    public interface Task%3CT%3E %7B%0A        void run(@NonNull T obj);%0A    %7D%0A%7D%0A

create a WeakTask class