Skip to content

Commit

Permalink
simplify code using method reference
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed May 30, 2022
1 parent 350c78b commit db82161
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -49,7 +49,7 @@ public void shouldReturnFirstHighPriority() {
List<Serializable> things = of(new Computer(), new Animal(), new Machine(), new Person())
.map(ServiceLoaderSort::of)
.sorted()
.map(s -> s.get())
.map(ServiceLoaderSort::get)
.collect(Collectors.toList());

Assertions.assertTrue(things.get(0) instanceof Animal);
Expand Down

0 comments on commit db82161

Please sign in to comment.