title: How can I avoid NullPointerException warning in this Java lambda expression code?
body: <p>How can I avoid NullPointerException warning in this Java code?
  I am working with IntelliJ and I am getting this warning:</p>
  
  <blockquote>
    <p>Method Invocation 'getChartController()' may produce
    'java.Lang.NullPointerException'"                     </p>
  </blockquote>
  
  <pre><code>chartControlButtons.add(
      new JButton("Zoom In") {{
          addActionListener(
              (ActionEvent e) -&gt; getChartController().zoomIn()
          );
      }}
  );
  </code></pre>