Lines Matching refs:Lists
59 * Unit test for {@code Lists}.
90 = Lists.newArrayList(1, 2, 3, 4);
93 = Lists.newLinkedList(asList(1, 2, 3, 4));
119 return Lists.asList(elements[0], rest);
122 .named("Lists.asList, 2 parameter")
132 return Lists.asList(elements[0], elements[1], rest);
135 .named("Lists.asList, 3 parameter")
146 List<String> fromList = Lists.newArrayList();
150 return Lists.transform(fromList, removeFirst);
153 .named("Lists.transform, random access, no nulls")
162 List<String> fromList = Lists.newLinkedList();
166 return Lists.transform(fromList, removeFirst);
169 .named("Lists.transform, sequential access, no nulls")
178 List<String> fromList = Lists.newArrayList(elements);
179 return Lists.transform(fromList, Functions.<String>identity());
182 .named("Lists.transform, random access, nulls")
192 Lists.newLinkedList(asList(elements));
193 return Lists.transform(fromList, Functions.<String>identity());
196 .named("Lists.transform, sequential access, nulls")
205 List<String> list = Lists.newArrayList();
208 return Lists.reverse(list);
210 }).named("Lists.reverse[ArrayList]").withFeatures(CollectionSize.ANY,
219 return Lists.reverse(asList(reverseElements));
221 }).named("Lists.reverse[Arrays.asList]").withFeatures(CollectionSize.ANY,
227 List<String> list = Lists.newLinkedList();
230 return Lists.reverse(list);
232 }).named("Lists.reverse[LinkedList]").withFeatures(CollectionSize.ANY,
241 return Lists.reverse(builder.build());
243 }).named("Lists.reverse[ImmutableList]").withFeatures(CollectionSize.ANY,
248 .named("Lists.charactersOf[String]").withFeatures(
255 .named("Lists.charactersOf[CharSequence]").withFeatures(
264 List<Character> chars = Lists.charactersOf(builder);
275 ArrayList<Integer> list = Lists.newArrayList();
280 ArrayList<Integer> list = Lists.newArrayListWithCapacity(0);
283 ArrayList<Integer> bigger = Lists.newArrayListWithCapacity(256);
289 Lists.newArrayListWithCapacity(-1);
296 ArrayList<Integer> list = Lists.newArrayListWithExpectedSize(0);
299 ArrayList<Integer> bigger = Lists.newArrayListWithExpectedSize(256);
305 Lists.newArrayListWithExpectedSize(-1);
312 ArrayList<Integer> list = Lists.newArrayList(0, 1, 1);
317 assertEquals(5, Lists.computeArrayListCapacity(0));
318 assertEquals(13, Lists.computeArrayListCapacity(8));
319 assertEquals(89, Lists.computeArrayListCapacity(77));
320 assertEquals(22000005, Lists.computeArrayListCapacity(20000000));
322 Lists.computeArrayListCapacity(Integer.MAX_VALUE - 1000));
326 ArrayList<Integer> list = Lists.newArrayList(SOME_COLLECTION);
331 ArrayList<Integer> list = Lists.newArrayList(SOME_ITERABLE);
336 ArrayList<Integer> list = Lists.newArrayList(SOME_COLLECTION.iterator());
341 LinkedList<Integer> list = Lists.newLinkedList();
346 LinkedList<Integer> list = Lists.newLinkedList(SOME_COLLECTION);
351 LinkedList<Integer> list = Lists.newLinkedList(SOME_ITERABLE);
357 CopyOnWriteArrayList<Integer> list = Lists.newCopyOnWriteArrayList();
363 CopyOnWriteArrayList<Integer> list = Lists.newCopyOnWriteArrayList(
371 tester.testAllPublicStaticMethods(Lists.class);
376 * {@code Lists#newArrayList}.
379 List<String> ourWay = Lists.newArrayList("foo", "bar", "baz");
406 List<String> list = Lists.asList("foo", new String[] { "bar", "baz" });
415 return Lists.asList("foo", new String[] {"bar", "baz"}).iterator();
431 List<String> list = Lists.asList("foo", new String[0]);
442 return Lists.asList("foo", new String[0]).iterator();
448 List<String> list = Lists
455 return Lists.asList("foo", "bar", new String[] {"baz"}).iterator();
462 List<String> list = Lists.asList("foo", "bar", new String[0]);
475 return Lists.asList("foo", "bar", new String[0]).iterator();
489 List<Integer> fromList = Lists.newArrayList(SOME_LIST);
490 List<Integer> toList = Lists.reverse(fromList);
495 List<Integer> fromList = Lists.newLinkedList(SOME_SEQUENTIAL_LIST);
496 List<Integer> toList = Lists.reverse(fromList);
535 assertThat(Lists.cartesianProduct(list(1), list(2))).has().item(list(1, 2));
540 assertThat(Lists.cartesianProduct(list(1), list(2, 3)))
546 assertThat(Lists.cartesianProduct(list(1, 2), list(3, 4)))
552 assertThat(Lists.cartesianProduct(list(0, 1), list(0, 1), list(0, 1))).has().exactly(
559 List<List<Integer>> actual = Lists.cartesianProduct(list(1, 2), list(3, 4));
577 assertThat(Lists.<Object>cartesianProduct(x, y))
585 Lists.cartesianProduct(list, list, list, list, list);
591 List<String> list = Lists.transform(SOME_LIST, SOME_FUNCTION);
596 List<String> list = Lists.transform(SOME_SEQUENTIAL_LIST, SOME_FUNCTION);
601 List<Integer> fromList = Lists.newArrayList(SOME_LIST);
602 List<String> list = Lists.transform(fromList, SOME_FUNCTION);
607 List<Integer> fromList = Lists.newLinkedList(SOME_SEQUENTIAL_LIST);
608 List<String> list = Lists.transform(fromList, SOME_FUNCTION);
630 List<Integer> fromList = Lists.newArrayList(SOME_LIST);
631 List<String> toList = Lists.transform(fromList, SOME_FUNCTION);
636 List<Integer> fromList = Lists.newLinkedList(SOME_SEQUENTIAL_LIST);
637 List<String> toList = Lists.transform(fromList, SOME_FUNCTION);
663 List<String> list = Lists.transform(SOME_LIST, SOME_FUNCTION);
668 List<String> list = Lists.transform(SOME_SEQUENTIAL_LIST, SOME_FUNCTION);
673 List<Integer> fromList = Lists.newArrayList(SOME_LIST);
674 List<String> list = Lists.transform(fromList, SOME_FUNCTION);
679 List<Integer> fromList = Lists.newLinkedList(SOME_SEQUENTIAL_LIST);
680 List<String> list = Lists.transform(fromList, SOME_FUNCTION);
686 Lists.transform(ImmutableList.of("foo", "bar"), new Function<String, String>() {
739 List<Integer> fromList = Lists.newArrayList(SOME_LIST);
740 List<String> list = Lists.transform(fromList, SOME_FUNCTION);
745 List<Integer> fromList = Lists.newLinkedList(SOME_SEQUENTIAL_LIST);
746 List<String> list = Lists.transform(fromList, SOME_FUNCTION);
764 List<Integer> randomAccessList = Lists.newArrayList(SOME_SEQUENTIAL_LIST);
771 List<String> transform = Lists.transform(listMock, SOME_FUNCTION);
773 transform, Lists.transform(randomAccessList, SOME_FUNCTION)));
800 Lists.partition(source, 0);
808 List<List<Integer>> partitions = Lists.partition(source, 1);
815 List<List<Integer>> partitions = Lists.partition(source, 1);
822 List<List<Integer>> partitions = Lists.partition(source, 2);
829 List<List<Integer>> partitions = Lists.partition(source, 1);
837 List<List<Integer>> partitions = Lists.partition(source, 2);
846 List<List<Integer>> partitions = Lists.partition(source, 2);
862 List<Integer> source = Lists.newLinkedList(asList(1, 2, 3));
863 List<List<Integer>> partitions = Lists.partition(source, 2);
873 List<List<Integer>> partitions = Lists.partition(list, 3);
897 assertEquals(1, Lists.partition(list, Integer.MAX_VALUE).size());
898 assertEquals(1, Lists.partition(list, Integer.MAX_VALUE - 1).size());
903 assertEquals(2, Lists