title: Java if else in a lambda expression
body: <p>I am trying to use a lambda expression to evaluate to true or false on whether a input parameter to a method has a certain character '*' at the end of the string; as an input to a constructor to an object. im sure this is way off, but this is what i was trying to do before i looked around the web and saw some referring to using streams, but I'm not sure how or if they would work for this situation:</p>
  
  <pre><code>public void addPermission(String permission, String resource){
      permissions.put(new Permission(permission, 
  ()-&gt; {if (permission.charAt(permissions.size() - 1) == '*') return true; }));
  }
  </code></pre>
  
  <p>any input would be greatly appreciated. </p>