How to avoid multiple null checks, if need do something after the each check or how best to handle these checks? java 8+
public void method(Object obj){
if (Objects.nonNull(obj.getA())) {
do something;
}
if (Objects.nonNull(obj.getB())) {
do something;
}
if (Objects.nonNull(obj.getC())) {
do something;
}
do something;
}