Przykład

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

Rozwiązanie
    Użyj zmiennej do przechowania wyniku wywołania metody.

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