title: org.hamcrest.Matchers for matching different properties simultaneously of an Object
body: <p>I am trying to match two different properties of an Object by org.hamcrest.Matchers. Here it is: </p>
  
  <pre><code>List&lt;LeaveApply&gt; leaveApplyList = Lambda.select(
     allLeaveApplyList,
         Matchers.allOf(
              Lambda.having(
                  Lambda.on(LeaveApply.class).getUser().getId(),   
                  Matchers.equalTo(userId)), 
              Lambda.having(
                  Lambda.on(LeaveApply.class).getDate(),
                  Matchers.allOf(
                      Matchers.greaterThanOrEqualTo(fromDate), 
                      Matchers.lessThanOrEqualTo(toDate)))
                   )
                );
  </code></pre>
  
  <p>It gives a List of LeaveApply Object having user-id equals to given id and date less than or equals to to-date and greater than or equals to from-date. It is working. I want to know is it the right way to match different property fields?</p>