title: Repeated overriding of functional interface's abstract method?
body: <p>I have a functional interface in Java 8:    </p>
  
  <pre><code>public interface IFuncLambda1 {
      public int someInt();
  }
  </code></pre>
  
  <p>in main:</p>
  
  <pre><code>IFuncLambda1 iFuncL1 =  () -&gt; 5;
  System.out.println("\niFuncL1.someInt: " + iFuncL1.someInt());
  iFuncL1 = () -&gt; 1;
  System.out.println("iFuncL1.someInt: " + iFuncL1.someInt());
  </code></pre>
  
  <p>Running this will yield:</p>
  
  <pre><code>iFuncL1.someInt: 5
  iFuncL1.someInt: 1
  </code></pre>
  
  <p>Is this functionality OK as it is? Is it intended?</p>
  
  <p>If the overriding would be done in an implementing class, and the implementation would change at some point, then in every place that that method is called, the behaviour would be the same, we would have consistency. But if I change the behaviour/implementation through lambda expressions like in the example, the behaviour will only be valid til the next change, later on in the flow. This feels unreliable and hard to follow.</p>
  
  <p>EDIT:
  @assylias I don't see how someInt() has its behaviour changed...
  What if I added a param to someInt and have this code:</p>
  
  <pre><code>IFuncLambda1 iFuncL1 =  (x) -&gt; x - 1;
  System.out.println("\niFuncL1.someInt: " + iFuncL1.someInt(var));
  iFuncL1 = (x) -&gt; x + 1;
  System.out.println("iFuncL1.someInt: " + iFuncL1.someInt(var));
  </code></pre>
  
  <p>with var being a final even, how would you re-write that with classes?</p>