title: Java Error: incompatible types: no instance(s) of type variable(s) R exist so that Stream<R> conforms to boolean
body: <p>I am new to coding and
  I am getting an error in a java program that I have no idea how to solve. The code is meant to find the average time of cooking for a vegetarian recipe. As you can see below I tried putting a lambda expression inside the isVegetarian( ) method and I cant seem to figure out the problem.
  Thanks in advance.</p>
  
  <p>Here is the program:</p>
  
  <pre><code>public enum Ingredient
  {
  BEEF, HAM, APPLES, PEAS, CARROTS;
  }
     import java.util.ArrayList; 
  
  public class Recipe
  {
      public String name;
      public int time;
      public ArrayList&lt;Ingredient&gt; ingredient;
      public boolean meatveg;
  
  
      public int getTime( )
      {
          return time;
      }
      public boolean isVegetarian( )
      {
          meatveg = ingredient.stream( )
                      .filter((theingredients) -&gt; !( theingredients == Ingredient.BEEF || theingredients == Ingredient.HAM ))
                      .map((theingredients) -&gt; true );
          return meatveg;
      }
  
      public Recipe( String name, ArrayList&lt;Ingredient&gt; ingredient, int time )
      {
          this.name = name;
          this.ingredient = ingredient;
          this.time = time;
  
      }
  }
  import java.util.ArrayList;
  
  public class Recipes {
  
    public static void main(String[] args) {
      ArrayList&lt;Recipe&gt; recipes = new ArrayList&lt;&gt;();
  
  
      fillTheList(recipes);
  
      int total = recipes.stream()
          .filter((recipe) -&gt; recipe.isVegetarian())
          .map((recipe) -&gt; recipe.getTime())
          .reduce(0, (time1, time2) -&gt; time1 + time2);
  
      int count = recipes.stream()
          .filter((recipe) -&gt; recipe.isVegetarian())
          .map((recipe) -&gt; 1)
          .reduce(0, (value1, value2) -&gt; value1 + value2);
  
      System.out.println(total / (double) count);
    }
  
  
    static void fillTheList(ArrayList recipes) {
      ArrayList&lt;Ingredient&gt; ingredients = new ArrayList&lt;&gt;();
      ingredients.add(Ingredient.BEEF);
      ingredients.add(Ingredient.HAM);
      ingredients.add(Ingredient.APPLES);
      recipes.add(new Recipe("Recipe 1", ingredients, 400));
  
      ingredients = new ArrayList&lt;&gt;();
      ingredients.add(Ingredient.PEAS);
      ingredients.add(Ingredient.CARROTS);
      recipes.add(new Recipe("Recipe 2", ingredients, 200));
  
      ingredients = new ArrayList&lt;&gt;();
      ingredients.add(Ingredient.PEAS);
      ingredients.add(Ingredient.APPLES);
      recipes.add(new Recipe("Recipe 3", ingredients, 300));
    }
  
  
  }
  </code></pre>
  
  <p>And for this I get the error:</p>
  
  <pre><code>\Recipe.java:19: error: incompatible types: no instance(s) of type variable(s) R exist so that Stream&lt;R&gt; conforms to boolean
                                          .map((theingredients) -&gt; true );
                                              ^
    where R,T are type-variables:
      R extends Object declared in method &lt;R&gt;map(Function&lt;? super T,? extends R&gt;)
      T extends Object declared in interface Stream
  Note: Recipes.java uses unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  1 error
  </code></pre>