title: Why is this function allowing me to use a lambda expression
body: <p>Why is this function that takes an interface as a parameter allowing me to write a lambda expression? </p>
  
  <p>Take this function: </p>
  
  <pre><code>public ConditionBuilder&lt;T&gt; and(Condition&lt;T&gt; condition1) {
          conditional.getConditions().add(condition1);
          return this;
      }
  </code></pre>
  
  <p>This is what condition looks like: </p>
  
  <pre><code>public interface Condition&lt;T&gt; {
      boolean evaluate(T t);
  
  
      default boolean evaluateClause(T t, Condition&lt;T&gt; left, Condition&lt;T&gt; right, Operator operator) {
          switch (operator) {
              case AND:
                  return left.evaluate(t) &amp;&amp; right.evaluate(t);
              case OR:
                  return left.evaluate(t) || right.evaluate(t);
              default:
                  return false;
          }
      }
  
  
      default boolean evaluateStatement(T t, Collection&lt;Condition&lt;T&gt;&gt; conditions) {
          for (Condition condition : conditions) {
              if (!condition.evaluate(t)) return false;
          }
          return true;
      }
  }
  </code></pre>
  
  <p>I am not sure why I am allowed to write a lambda expression for this interface. I thought I would have to pass something that implements that interface instead it is letting me write a lambda. </p>
  
  <p>e.g. </p>
  
  <pre><code>return Conditional.&lt;User&gt;start(user -&gt; isUserNameUnique(user.getUserName()))
              .and(user -&gt; user.getFirstName() != null &amp;&amp; user.getLastName() != null)
              .and(user -&gt; !user.getFirstName().isEmpty() &amp;&amp; !user.getLastName().isEmpty())
              .or(user -&gt; isEmailUnique(user.getEmail()))
              .build();
  </code></pre>