I've got a simple method that checks there are no null in attributes:
public boolean isValid(){
     return session.getX() != null && session.getX().getY() != null &&
     session.getX().getY().getZ() != null;
}
This works, but, Is there any way to do this in a more elegant way?
Thanks a lot in advance.
 
     
     
    