@@ -0,0 +1,3363 @@
+package com.novoda.downloadmanager;%0A%0Aimport org.junit.Test;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static com.novoda.downloadmanager.InternalDownloadBatchStatusFixtures.anInternalDownloadsBatchStatus;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.reset;%0A%0Apublic class DownloadBatchStatusFilterTest %7B%0A%0A    private final DownloadBatchStatusCallback downloadBatchCallback = mock(DownloadBatchStatusCallback.class);%0A    private final DownloadBatchStatus firstPercentageStatus = anInternalDownloadsBatchStatus()%0A            .withPercentageDownloaded(75)%0A            .build();%0A    private final DownloadBatchStatus secondPercentageStatus = anInternalDownloadsBatchStatus()%0A            .withPercentageDownloaded(80)%0A            .build();%0A    private final DownloadBatchStatus firstErrorStatus = anInternalDownloadsBatchStatus()%0A            .withDownloadError(DownloadErrorFactory.createNetworkError(%22first%22))%0A            .build();%0A    private final DownloadBatchStatus secondErrorStatus = anInternalDownloadsBatchStatus()%0A            .withDownloadError(DownloadErrorFactory.createNetworkError(%22second%22))%0A            .build();%0A    private final DownloadBatchStatus firstStatus = anInternalDownloadsBatchStatus()%0A            .build();%0A    private final DownloadBatchStatus secondStatus = anInternalDownloadsBatchStatus()%0A            .withStatus(DownloadBatchStatus.Status.DOWNLOADED)%0A            .build();%0A%0A    private final DownloadBatchStatusFilter downloadBatchStatusFilter = new DownloadBatchStatusFilter();%0A%0A    @Test%0A    public void returnsFalse_whenPercentageDoesNotMatchPrevious() %7B%0A        givenPreviousUpdate(firstPercentageStatus);%0A%0A        boolean shouldFilterOut = downloadBatchStatusFilter.shouldFilterOut(secondPercentageStatus);%0A%0A        assertThat(shouldFilterOut).isFalse();%0A    %7D%0A%0A    @Test%0A    public void returnsTrue_whenPercentageIsUnchanged() %7B%0A        givenPreviousUpdate(firstPercentageStatus);%0A%0A        boolean shouldFilterOut = downloadBatchStatusFilter.shouldFilterOut(firstPercentageStatus);%0A%0A        assertThat(shouldFilterOut).isTrue();%0A    %7D%0A%0A    @Test%0A    public void returnsFalse_whenErrorDoesNotMatchPrevious() %7B%0A        givenPreviousUpdate(firstErrorStatus);%0A%0A        boolean shouldFilterOut = downloadBatchStatusFilter.shouldFilterOut(secondErrorStatus);%0A%0A        assertThat(shouldFilterOut).isFalse();%0A    %7D%0A%0A    @Test%0A    public void returnsTrue_whenErrorIsUnchanged() %7B%0A        givenPreviousUpdate(firstErrorStatus);%0A%0A        boolean shouldFilterOut = downloadBatchStatusFilter.shouldFilterOut(firstErrorStatus);%0A%0A        assertThat(shouldFilterOut).isTrue();%0A    %7D%0A%0A    @Test%0A    public void returnsFalse_whenStatusDoesNotMatchPrevious() %7B%0A        givenPreviousUpdate(firstStatus);%0A%0A        boolean shouldFilterOut = downloadBatchStatusFilter.shouldFilterOut(secondStatus);%0A%0A        assertThat(shouldFilterOut).isFalse();%0A    %7D%0A%0A    @Test%0A    public void returnsTrue_whenStatusIsUnchanged() %7B%0A        givenPreviousUpdate(firstStatus);%0A%0A        boolean shouldFilterOut = downloadBatchStatusFilter.shouldFilterOut(firstStatus);%0A%0A        assertThat(shouldFilterOut).isTrue();%0A    %7D%0A%0A    private void givenPreviousUpdate(DownloadBatchStatus downloadBatchStatus) %7B%0A        downloadBatchStatusFilter.shouldFilterOut(downloadBatchStatus);%0A        reset(downloadBatchCallback);%0A    %7D%0A%7D%0A

Add tests for DownloadBatchStatusFilter.