Is there any way to create a chain of method references like;
Chain chain = Product::getType::getTypeInfo::getTypeInfoId;
I want to create a generic null check method.
public Optional checkIfNull(Object object, Chain chain){
return Optional.ofNullable(object).map(chain).isPresent();
}