cleanup work
This commit is contained in:
@@ -17,7 +17,6 @@ public class CollectPatternTest {
|
||||
|
||||
MutableList<String> lastNames = students.collect(Student::getLastName);
|
||||
|
||||
Assertions.assertThat(lastNames)
|
||||
.containsExactly("Hopkins", "Adams");
|
||||
Assertions.assertThat(lastNames).containsExactly("Hopkins", "Adams");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -12,7 +12,6 @@ public class ConvertContainerToAnotherTest {
|
||||
public void whenConvertContainerToAnother_thenCorrect() {
|
||||
MutableList<String> cars = (MutableList) ConvertContainerToAnother.convertToList();
|
||||
|
||||
Assertions.assertThat(cars)
|
||||
.containsExactlyElementsOf(FastList.newListWith("Volkswagen", "Toyota", "Mercedes"));
|
||||
Assertions.assertThat(cars).containsExactlyElementsOf(FastList.newListWith("Volkswagen", "Toyota", "Mercedes"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ public class DetectPatternTest {
|
||||
public void whenDetect_thenCorrect() {
|
||||
Integer result = list.detect(Predicates.greaterThan(30));
|
||||
|
||||
Assertions.assertThat(result)
|
||||
.isEqualTo(41);
|
||||
Assertions.assertThat(result).isEqualTo(41);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ public class FlatCollectTest {
|
||||
public void whenFlatCollect_thenCorrect() {
|
||||
MutableList<String> addresses = students.flatCollect(Student::getAddresses);
|
||||
|
||||
Assertions.assertThat(addresses)
|
||||
.containsExactlyElementsOf(this.expectedAddresses);
|
||||
Assertions.assertThat(addresses).containsExactlyElementsOf(this.expectedAddresses);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class InjectIntoPatternTest {
|
||||
Integer v = list.get(i);
|
||||
result = result + v.intValue();
|
||||
}
|
||||
|
||||
|
||||
assertEquals(15, result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ public class LazyIterationTest {
|
||||
LazyIterable<Student> lazyStudents = students.asLazy();
|
||||
LazyIterable<String> lastNames = lazyStudents.collect(Student::getLastName);
|
||||
|
||||
Assertions.assertThat(lastNames)
|
||||
.containsAll(Lists.mutable.with("Hopkins", "Adams", "Rodriguez"));
|
||||
Assertions.assertThat(lastNames).containsAll(Lists.mutable.with("Hopkins", "Adams", "Rodriguez"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,14 +31,10 @@ public class PartitionPatternTest {
|
||||
return each > 30;
|
||||
}
|
||||
});
|
||||
MutableList<Integer> greaterThanThirty = partitionedFolks.getSelected()
|
||||
.sortThis();
|
||||
MutableList<Integer> smallerThanThirty = partitionedFolks.getRejected()
|
||||
.sortThis();
|
||||
MutableList<Integer> greaterThanThirty = partitionedFolks.getSelected().sortThis();
|
||||
MutableList<Integer> smallerThanThirty = partitionedFolks.getRejected().sortThis();
|
||||
|
||||
Assertions.assertThat(smallerThanThirty)
|
||||
.containsExactly(1, 5, 8, 17, 23);
|
||||
Assertions.assertThat(greaterThanThirty)
|
||||
.containsExactly(31, 38, 41);
|
||||
Assertions.assertThat(smallerThanThirty).containsExactly(1, 5, 8, 17, 23);
|
||||
Assertions.assertThat(greaterThanThirty).containsExactly(31, 38, 41);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,8 @@ public class RejectPatternTest {
|
||||
|
||||
@Test
|
||||
public void whenReject_thenCorrect() {
|
||||
MutableList<Integer> notGreaterThanThirty = list.reject(Predicates.greaterThan(30))
|
||||
.sortThis();
|
||||
MutableList<Integer> notGreaterThanThirty = list.reject(Predicates.greaterThan(30)).sortThis();
|
||||
|
||||
Assertions.assertThat(notGreaterThanThirty)
|
||||
.containsExactlyElementsOf(this.expectedList);
|
||||
Assertions.assertThat(notGreaterThanThirty).containsExactlyElementsOf(this.expectedList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,17 +18,14 @@ public class SelectPatternTest {
|
||||
|
||||
@Test
|
||||
public void givenListwhenSelect_thenCorrect() {
|
||||
MutableList<Integer> greaterThanThirty = list.select(Predicates.greaterThan(30))
|
||||
.sortThis();
|
||||
MutableList<Integer> greaterThanThirty = list.select(Predicates.greaterThan(30)).sortThis();
|
||||
|
||||
Assertions.assertThat(greaterThanThirty)
|
||||
.containsExactly(31, 38, 41);
|
||||
Assertions.assertThat(greaterThanThirty).containsExactly(31, 38, 41);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public MutableList selectUsingLambda() {
|
||||
return list.select(each -> each > 30)
|
||||
.sortThis();
|
||||
return list.select(each -> each > 30).sortThis();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -36,7 +33,6 @@ public class SelectPatternTest {
|
||||
public void givenListwhenSelectUsingLambda_thenCorrect() {
|
||||
MutableList<Integer> greaterThanThirty = selectUsingLambda();
|
||||
|
||||
Assertions.assertThat(greaterThanThirty)
|
||||
.containsExactly(31, 38, 41);
|
||||
Assertions.assertThat(greaterThanThirty).containsExactly(31, 38, 41);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ public class ZipTest {
|
||||
MutableList<String> cars = Lists.mutable.with("Porsche", "Volvo", "Toyota");
|
||||
MutableList<Pair<String, String>> pairs = numbers.zip(cars);
|
||||
|
||||
Assertions.assertThat(pairs)
|
||||
.containsExactlyElementsOf(this.expectedPairs);
|
||||
Assertions.assertThat(pairs).containsExactlyElementsOf(this.expectedPairs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ public class ZipWithIndexTest {
|
||||
MutableList<String> cars = FastList.newListWith("Porsche", "Volvo", "Toyota");
|
||||
MutableList<Pair<String, Integer>> pairs = cars.zipWithIndex();
|
||||
|
||||
Assertions.assertThat(pairs)
|
||||
.containsExactlyElementsOf(this.expectedPairs);
|
||||
Assertions.assertThat(pairs).containsExactlyElementsOf(this.expectedPairs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user