PojoWithCollection fill() { someCollectionObjectV = newList(new Object[] { "foo", 1, 1.1f, 100.001d, System.currentTimeMillis(), new Date(), Size.LARGE, new Pojo().fill(), new BassGuitar(4, true) }); Collection<Object> collectionWildcardV = newList(new Object[] { "bar", Size.SMALL, new AcousticGuitar(GuitarPickup.MICROPHONE) }); someCollectionWildcardV = collectionWildcardV; someListObjectV = newList(new Object[] { "baz", 2, 2.2f, 200.002d, Size.MEDIUM, new BassGuitar(6, true) }); List<Object> listWildcardV = newList(new Object[] { "gg", 3, 30.03f, 300.003d, 300000l, new BassGuitar(5, false) }); someListWildcardV = listWildcardV; return this; }
PojoWithHashMapInnerKeySetAsDelegate fill() { Map<String, String> map1 = newMap(); map1.put("hello", "world"); map1.put("oh", "hi"); Map<String, String> map2 = newMap(); map2.put("abc", "123"); map2.put("good", "cool"); Map<String, String> map3 = newMap(); map3.put("yummy", "cake"); list = newList(map1.keySet()); set = map2.keySet(); map = newMap(); map.put("key", map3.keySet()); return this; }
PojoWithThrowable fill() { t1 = new Throwable("t1"); t2 = new Exception("t2", t1); o1 = t1; o2 = t2; e1 = new Exception("e1"); e2 = new RuntimeException("e2", e1); re1 = new RuntimeException("re1"); re2 = new RuntimeException("re2", re1); l1 = newList(t1, e1, re1); l2 = newList(o2, e2, re2); l3 = l1; l4 = l2; m1 = newMap(); m1.put("t1", t1); m2 = newMap(); m2.put("e1", e1); m3 = newMap(); m3.put(e2, re2); m4 = m1; m5 = m2; m6 = m3; return this; }
PojoWithSingletonAsDelegate fill() { s2 = s1 = Singleton.INSTANCE; l3 = l1 = newList(Singleton.INSTANCE); l2 = newList(); l2.add(Singleton.INSTANCE); l4 = l2; m1 = newMap(); m1.put("s1", s1); m2 = newMap(); m2.put("s1", s1); m3 = newMap(); m3.put(s1, s1); m4 = newMap(); m4.put(s1, "s1"); m5 = m1; m6 = m2; m7 = m3; m8 = m4; return this; }
PojoWithShortArrayAsDelegate fill() { short[] s = new short[] { 0x7f7f, 0x7e7e }; s2 = s1 = s; l3 = l1 = newList(s); l2 = newList(); l2.add(s); l4 = l2; m1 = newMap(); m1.put("s1", s1); m2 = newMap(); m2.put("s1", s1); m3 = newMap(); m3.put(s1, s1); m4 = newMap(); m4.put(s1, "s1"); m5 = m1; m6 = m2; m7 = m3; m8 = m4; return this; }
unmodifiableList = Collections.unmodifiableList(ll); unmodifiableRandomAccessList = Collections .unmodifiableList(newList("six")); synchronizedList = Collections.synchronizedList(ll); synchronizedRandomAccessList = Collections .synchronizedList(newList("seven")); checkedCollection = Collections.checkedCollection(newList("eight"), String.class); // no equals impl checkedSet = Collections.checkedSet(es, Size.class); checkedSortedSet = Collections.checkedSortedSet(ts, String.class); checkedList = Collections.checkedList(ll, String.class); checkedRandomAccessList = Collections.checkedList(newList("nine"), String.class);
PojoWithImmutableListAsDelegate fill() { List<Baz> bazList = newList( new Baz(567, "baz", 202020202), new Baz(999, "buzz", 10101010) ); list = new ImmutableList(bazList); return this; }
expectCollectionStringV = newList(new String[] { "bar", "baz" }); expectCollectionEnumV = newList(new Size[] { Size.SMALL, Size.MEDIUM, Size.LARGE }); expectCollectionGuitarV = newList(new Guitar[] { new AcousticGuitar(GuitarPickup.MICROPHONE), new BassGuitar(5, true) }); List<Integer> intFirst = newList(new Integer[] { 1, 2, 3, 4 }); List<Integer> intSecond = newList(new Integer[] { 4, 5, 6, 7 }); expectCollectionIntegerCollectionV = newList(new List[] { intFirst, intSecond }); List<Size> enumFirst = newList(new Size[] { Size.SMALL }); List<Size> enumSecond = newList(new Size[] { Size.MEDIUM }); List<Size> enumThird = newList(new Size[] { Size.LARGE }); expectCollectionEnumCollectionV = newList(new List[] { enumFirst, enumSecond, enumThird }); List<Guitar> guitarFirst = newList(new Guitar[] { new AcousticGuitar(GuitarPickup.MICROPHONE), new BassGuitar(5, true) }); List<Guitar> guitarSecond = newList(new Guitar[] { new AcousticGuitar(GuitarPickup.CONTACT),
newList(new String[] { "foo", "bar", "baz" }), newList(new String[] { "1", "2" }), newList(new String[] { "3" }) }; expectListPojoVArray = new List[] { newList(new Pojo[] { new Pojo() .fill() }) }; newList(new Guitar[] { new BassGuitar(6, true), new AcousticGuitar(GuitarPickup.UNDER_THE_SADDLE) }), newList(new Guitar[] { new BassGuitar(5, false), }) }; expectListObjectVArray = new List[] { newList(new Object[] { new Pojo().fill(), new AcousticGuitar(GuitarPickup.CONTACT),