refactor: Use 'of' instead of Stream 'builder'
Simplify the construction of a Stream by using the 'of()' method instead of a 'builder' Resolves: BAEL-632
This commit is contained in:
parent
f1322a34a6
commit
351af60bce
|
@ -39,7 +39,7 @@ public class CustomAnswerWithLambdaUnitTest {
|
|||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
when(jobService.listJobs(any(Person.class))).then((i) -> {
|
||||
return ((Person) i.getArgument(0)).getName().equals("Peter") ? Stream.<JobPosition> builder().add(new JobPosition("Teacher")).build() : Stream.empty();
|
||||
return ((Person) i.getArgument(0)).getName().equals("Peter") ? Stream.of(new JobPosition("Teacher")) : Stream.empty();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue