@@ -0,0 +1,2770 @@
+package com.amalgam.collection;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.robolectric.RobolectricTestRunner;%0Aimport org.robolectric.annotation.Config;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Created by Hideyuki.Kikuma on 2014/10/10.%0A */%0A@RunWith(RobolectricTestRunner.class)%0A@Config(emulateSdk = 18)%0Apublic class CollectionUtilsTest %7B%0A    @Test%0A    public void testToString() %7B%0A        // null%0A        Assert.assertEquals(%22null%22, CollectionUtils.toString(null));%0A%0A        List%3CString%3E stringList = new ArrayList%3CString%3E();%0A        // empty%0A        Assert.assertEquals(%22%7B%7D%22, CollectionUtils.toString(stringList));%0A        stringList.add(%22foo%22);%0A        Assert.assertEquals(%22%7Bfoo%7D%22, CollectionUtils.toString(stringList));%0A        stringList.add(%22bar%22);%0A        Assert.assertEquals(%22%7Bfoo,bar%7D%22, CollectionUtils.toString(stringList));%0A        stringList.add(null);%0A        Assert.assertEquals(%22%7Bfoo,bar,null%7D%22, CollectionUtils.toString(stringList));%0A%0A        List%3CFoo%3E fooList = new ArrayList%3CFoo%3E();%0A        // empty%0A        Assert.assertEquals(%22%7B%7D%22, CollectionUtils.toString(fooList));%0A        fooList.add(new Foo(%221%22));%0A        Assert.assertEquals(%22%7Bfoo1%7D%22, CollectionUtils.toString(fooList));%0A        fooList.add(new Foo(%222%22));%0A        Assert.assertEquals(%22%7Bfoo1,foo2%7D%22, CollectionUtils.toString(fooList));%0A        fooList.add(null);%0A        Assert.assertEquals(%22%7Bfoo1,foo2,null%7D%22, CollectionUtils.toString(fooList));%0A    %7D%0A%0A    @Test%0A    public void testGetLastIndex() %7B%0A        Assert.assertEquals(0, CollectionUtils.getLastIndex(null));%0A        List%3CString%3E list = new ArrayList%3CString%3E();%0A        Assert.assertEquals(0, CollectionUtils.getLastIndex(list));%0A        list.add(%221%22);%0A        Assert.assertEquals(0, CollectionUtils.getLastIndex(list));%0A        list.add(%222%22);%0A        Assert.assertEquals(1, CollectionUtils.getLastIndex(list));%0A        list.add(%224%22);%0A        Assert.assertEquals(2, CollectionUtils.getLastIndex(list));%0A    %7D%0A%0A    @Test%0A    public void testIsEmpty() %7B%0A        Assert.assertTrue(CollectionUtils.isEmpty(null));%0A        List%3CString%3E list = new ArrayList%3CString%3E();%0A        Assert.assertTrue(CollectionUtils.isEmpty(list));%0A        list.add(%221%22);%0A        Assert.assertFalse(CollectionUtils.isEmpty(list));%0A        list.add(%222%22);%0A        Assert.assertFalse(CollectionUtils.isEmpty(list));%0A        list.add(%224%22);%0A        Assert.assertFalse(CollectionUtils.isEmpty(list));%0A        list.clear();%0A        Assert.assertTrue(CollectionUtils.isEmpty(list));%0A    %7D%0A%0A    private class Foo %7B%0A        private String mName;%0A%0A        public Foo(String name) %7B%0A            mName = name;%0A        %7D%0A%0A        public String toString() %7B%0A            return %22foo%22 + mName;%0A        %7D%0A%0A    %7D%0A%7D%0A

add CollectionUtilsTest