I want to know how to execute code from a stream if the filter does not find values and finds it, an example code:
@Transactional
public void change(ClassName dep){
// code
dep.getFoo()
.stream()
.filter(f -> f.getName().equals(doo.getName))
}
if the filter has a value then:
user.setFoo(f);
if there is no value in the filter then:
Foo foo = new Foo();
foo.setName("Exp");
user.setFoo(foo);