title: Applying OR predicate Java 8
body: <p>I have employee object</p>
  
  <pre><code>public class Employee {
  
      public Employee(Integer id, Integer age, String gender, String fName, String lName) {
          this.id = id;
          this.age = age;
          this.gender = gender;
          this.firstName = fName;
          this.lastName = lName;
      }
  
      private Integer id;
      private Integer age;
      private String gender;
      private String firstName;
      private String lastName;
  </code></pre>
  
  <p>I have two predicates</p>
  
  <pre><code>public static Predicate&lt;Employee&gt; firstNameLike(final String name) {
          return p -&gt; p.getFirstName().contains(name);
      }
  
  
      public static Predicate&lt;Employee&gt; isAdultFemale() {
          return p -&gt; p.getAge() &gt; 18 &amp;&amp; p.getGender().equalsIgnoreCase("F");
      }
  </code></pre>
  
  <p><em>I am applying multiple filters to the employees e.g.</em></p>
  
  <pre><code>public class TestEmployeePredicates {
      public static void main(String[] args) {
  
          Employee e2 = new Employee(2, 13, "F", "Martina", "Hengis");
          Employee e5 = new Employee(5, 19, "F", "Cristine", "Maria");
          Employee e7 = new Employee(7, 68, "F", "Melissa", "Roy");
          Employee e9 = new Employee(9, 15, "F", "Neetu", "Singh");
  
  
          Employee e1 = new Employee(1, 23, "M", "Rick", "Beethovan");
          Employee e3 = new Employee(3, 43, "M", "Ricky", "Martin");
          Employee e4 = new Employee(4, 26, "M", "Jon", "Lowman");
          Employee e6 = new Employee(6, 15, "M", "David", "Feezor");
          Employee e8 = new Employee(8, 79, "M", "Alex", "Gussin");
          Employee e10 = new Employee(10, 45, "M", "Naveen", "Jain");
  
  
          List&lt;Employee&gt; employees = new ArrayList&lt;Employee&gt;();
          employees.addAll(Arrays.asList(new Employee[]{e1, e2, e3, e4, e5, e6, e7, e8, e9, e10}));
  
  
          List&lt;Predicate&lt;Employee&gt;&gt; predicates = new ArrayList&lt;&gt;();
  
  
          predicates.add(EmployeePredicates.isAdultFemale());
          predicates.add(EmployeePredicates.firstNameLike("J"));
  
  
          final Predicate&lt;Employee&gt; employeePredicate = predicates.stream().reduce(Predicate::and).get();
  
          //OR adult male
          employeePredicate.or(EmployeePredicates.isAdultMale());
  
  
          final List&lt;Employee&gt; collect = employees.stream().filter(employeePredicate).collect(Collectors.toList());
  
          System.out.println(collect.size());
  </code></pre>
  
  <p>As per my logic it should check the list </p>
  
  <p>if its <code>AdultFemale</code> and <code>firstname like "J"</code> OR its <code>Adult Male</code></p>
  
  <p>But This is not working as per the logic. What I am doing wrong here? Even if the employee is Adult MALE its filtering out.</p>