How to use the value of a method result based on a test?
I believe fooclass is a reference of Foo class. I can only think about introducing a variable and check it to prevent the double-invokation of same method.

String fooInfo = fooclass.getInfoText();
if (!"".equals(fooInfo))
{
    this.setInfoText(fooInfo);
}


NOTE 

I'm using "".equals(fooInfo) to avoid NPE.