From d9a7757602670a70ad46908cfb7172afe65d0fbd Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Mon, 12 Sep 2016 22:02:51 +0200 Subject: [PATCH] Reformat code --- .../java/collections/ArrayListTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core-java/src/test/java/org/baeldung/java/collections/ArrayListTest.java b/core-java/src/test/java/org/baeldung/java/collections/ArrayListTest.java index 7a80d802e9..9cafa179ab 100644 --- a/core-java/src/test/java/org/baeldung/java/collections/ArrayListTest.java +++ b/core-java/src/test/java/org/baeldung/java/collections/ArrayListTest.java @@ -19,9 +19,9 @@ public class ArrayListTest { @Before public void setUp() { List xs = LongStream.range(0, 16) - .boxed() - .map(Long::toHexString) - .collect(toCollection(ArrayList::new)); + .boxed() + .map(Long::toHexString) + .collect(toCollection(ArrayList::new)); stringsToSearch = new ArrayList<>(xs); stringsToSearch.addAll(xs); } @@ -35,7 +35,7 @@ public class ArrayListTest { @Test public void givenCollection_whenProvideItToArrayListCtor_thenArrayListIsPopulatedWithItsElements() { Collection numbers = - IntStream.range(0, 10).boxed().collect(toSet()); + IntStream.range(0, 10).boxed().collect(toSet()); List xs = new ArrayList<>(numbers); assertEquals(10, xs.size()); @@ -57,7 +57,7 @@ public class ArrayListTest { public void givenCollection_whenAddToArrayList_thenIsAdded() { List xs = new ArrayList<>(Arrays.asList(1L, 2L, 3L)); LongStream.range(4, 10).boxed() - .collect(collectingAndThen(toList(), ys -> xs.addAll(0, ys))); + .collect(collectingAndThen(toCollection(ArrayList::new), ys -> xs.addAll(0, ys))); assertThat(Arrays.asList(4L, 5L, 6L, 7L, 8L, 9L, 1L, 2L, 3L), equalTo(xs)); } @@ -89,9 +89,9 @@ public class ArrayListTest { Set matchingStrings = new HashSet<>(Arrays.asList("a", "c", "9")); List result = stringsToSearch - .stream() - .filter(matchingStrings::contains) - .collect(toCollection(ArrayList::new)); + .stream() + .filter(matchingStrings::contains) + .collect(toCollection(ArrayList::new)); assertEquals(6, result.size()); } @@ -132,7 +132,7 @@ public class ArrayListTest { @Test public void givenCondition_whenIterateArrayList_thenRemoveAllElementsSatisfyingCondition() { Set matchingStrings - = Sets.newHashSet("a", "b", "c", "d", "e", "f"); + = Sets.newHashSet("a", "b", "c", "d", "e", "f"); Iterator it = stringsToSearch.iterator(); while (it.hasNext()) {