title: Is there a more concise way to write this Java code?
body: <p>This <code>foo</code> that is returned by <code>lookup</code> could be <code>null</code>.</p>
  
  <p>That's why I'm trying to avoid calling <code>foo.getFooStr()</code> on a <code>null</code> value by first returning <code>null</code> if <code>foo</code> is <code>null</code>.</p>
  
  <p>But is there a better (more concise) way to write this?</p>
  
  <pre><code>public static String getFooStr(String input)
  {
      Foo foo = lookup(input);
      if(foo==null)
      {
          return null;
      }
      return foo.getFooStr();
  }
  </code></pre>