How to check object for null in this case?

I have to get fields from an object that is inside other objects. How can I check it for null correctly? example:

 if (comServiceResponses.get(0) != null && comServiceResponses.get(0).getComment() != null &&
            comServiceResponses.get(0).getComment().getComs().get(0) != null) {

        name = comServiceResponses.get(0).getComment().getComs().get(0).getOwner();
        address = comServiceResponses.get(0).getComment().getComs().get(0).getAddress();
}

Ответы (0 шт):