title: How do I replace an anonymous class with a lambda in Java?
body: <p>I've got this code but IntelliJ tells me to replace anonymous with lambda but I don't know how. can anyone help me with this?
  Here is my code:</p>
  
  <pre><code>soundVolume.valueProperty().addListener(new ChangeListener&lt;Number&gt;() {
      public void changed(ObservableValue&lt;? extends Number&gt; ov,
                       Number old_val, Number new_val) {
          main.setSoundVolume(new_val.doubleValue());
          main.getMediaPlayer().setVolume(main.getSoundVolume());
      }
  }); 
  </code></pre>