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:
Felipe Reis 2017-03-02 18:16:06 -03:00
parent f1322a34a6
commit 351af60bce
1 changed files with 1 additions and 1 deletions

View File

@ -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();
});
}
}