package com.novoda.downloadmanager;

class DownloadBatchStatusFilter {

    private InternalDownloadBatchStatus currentStatus;

    boolean shouldFilterOut(DownloadBatchStatus currentDownloadBatchStatus) {
        if (!(currentDownloadBatchStatus instanceof InternalDownloadBatchStatus)) {
            return true;
        }

        InternalDownloadBatchStatus copiedStatus = ((InternalDownloadBatchStatus) currentDownloadBatchStatus).copy();
        if (copiedStatus.equals(currentStatus)) {
            return true;
        }

        currentStatus = copiedStatus;
        return false;
    }
}

@@ -275,32 +275,157 @@
 BatchStatus)) %7B%0A
+            Logger.w(currentDownloadBatchStatus.getClass() + %22 is not an instance of %22 + InternalDownloadBatchStatus.class);%0A
             retu
@@ -624,39 +624,526 @@
         
-return true;%0A        %7D%0A
+Logger.v(%22Failed filter. %22%0A                             + %22ID: %22 + currentDownloadBatchStatus.getDownloadBatchId().rawId()%0A                             + %22 Status: %22 + currentDownloadBatchStatus.status().toRawValue()%0A            );%0A            return true;%0A        %7D%0A%0A        Logger.v(%0A                %22Passes filter. %22%0A                        + %22ID: %22 + currentDownloadBatchStatus.getDownloadBatchId().rawId()%0A                        + %22 Status: %22 + currentDownloadBatchStatus.status().toRawValue()%0A        );
 %0A       

Add logs to filter.