@@ -0,0 +1,3122 @@
+package com.futurice.freesound.utils;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.Collection;%0Aimport java.util.Collections;%0A%0Aimport rx.Observable;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Apublic class CollectionUtilsTest %7B%0A%0A    @Test%0A    public void areEqual_returnsTrue_whenTheCollectionsContainSameElementsInSameOrder() %7B%0A        Collection collection1 = createRangeCollection(0, 5);%0A        Collection collection2 = createRangeCollection(0, 5);%0A%0A        boolean areEqual = CollectionUtils.areEqual(collection1, collection2);%0A%0A        assertThat(areEqual).isTrue();%0A    %7D%0A%0A    @Test%0A    public void areEqual_returnsFalse_whenTheCollectionsHaveSameElementsInDifferentOrder() %7B%0A        Collection collection1 = createRangeCollection(0, 5);%0A        Collection collection2 = createRangeCollection(5, 0);%0A%0A        boolean areEqual = CollectionUtils.areEqual(collection1, collection2);%0A%0A        assertThat(areEqual).isFalse();%0A    %7D%0A%0A    @Test%0A    public void areEqual_returnsFalse_whenTheCollectionsContainDifferentElements() %7B%0A        Collection collection1 = createRangeCollection(0, 5);%0A        Collection collection2 = createRangeCollection(5, 10);%0A%0A        boolean areEqual = CollectionUtils.areEqual(collection1, collection2);%0A%0A        assertThat(areEqual).isFalse();%0A    %7D%0A%0A    @Test%0A    public void areEqual_returnsFalse_whenTheCollectionsHaveDifferentSizes() %7B%0A        Collection collection1 = createRangeCollection(0, 5);%0A        Collection collection2 = createRangeCollection(0, 4);%0A%0A        boolean areEqual = CollectionUtils.areEqual(collection1, collection2);%0A%0A        assertThat(areEqual).isFalse();%0A    %7D%0A%0A    @Test%0A    public void areEqual_returnsFalse_whenOneCollectionIsNull() %7B%0A        Collection collection1 = createRangeCollection(0, 5);%0A        Collection collection2 = null;%0A%0A        boolean areEqual = CollectionUtils.areEqual(collection1, collection2);%0A%0A        assertThat(areEqual).isFalse();%0A    %7D%0A%0A    @Test%0A    public void areEqual_returnsFalse_whenBothCollectionsAreNull() %7B%0A        Collection collection1 = null;%0A        Collection collection2 = null;%0A%0A        boolean areEqual = CollectionUtils.areEqual(collection1, collection2);%0A%0A        assertThat(areEqual).isFalse();%0A    %7D%0A%0A    @Test%0A    public void areEqual_returnsTrue_whenTheTwoCollectionsAreEmpty() %7B%0A        Collection collection1 = Collections.EMPTY_LIST;%0A        Collection collection2 = Collections.EMPTY_LIST;%0A%0A        boolean areEqual = CollectionUtils.areEqual(collection1, collection2);%0A%0A        assertThat(areEqual).isTrue();%0A    %7D%0A%0A    private static Collection%3CInteger%3E createRangeCollection(final int start, final int end) %7B%0A        if (start %3C= end) %7B%0A            return Observable.range(start, end - start)%0A                             .toList()%0A                             .toBlocking()%0A                             .first();%0A        %7D else %7B%0A            return Observable.range(end, start - end)%0A                             .map(it -%3E (start + end) - it - 1)%0A                             .toList()%0A                             .toBlocking()%0A                             .first();%0A        %7D%0A    %7D%0A%7D%0A

Add tests to collection utils