As stated by Oracle,
You can serialize a lambda expression if its target type and its captured arguments are serializable. However, like inner classes, the serialization of lambda expressions is strongly discouraged.
Interesting that the following works:
import java.util.Optional;
public class Test {