Esempio

public static void main( String[] args ) {
Object object;
//....
if (object.getResult() != null) {
System.out.println(object.getResult());
}
}

Soluzione
    Utilizzare una variabile per memorizzare il risultato del richiamo del metodo

public static void main( String[] args ) {
Object object;
Object result = object.getResult();
if (result != null) {
System.out.println(result);
}
}