Gentlemen I made a simple code to filter a list by passing the Id and the goal would be to return an object. To make use of the stream I configured the libim annimon: stream and backlamb, I would like a critique of the code below, since it is my first contact with these functions of Java 8
return Stream.of(lista)
.filter( e -> e.getId() == id)
.map(e -> new Especialidade(e.getId(), e.getNome()))
.collect(Collectors.toList())
.get(0);