title: Is there a way to do deep comparison on a nested property with Hamcrest
body: <p>I use hamcrest for most of my testing ,but have encountered a issue with it not being able to test a property one level down in the object graph .A snipped of my test case is below</p>
  
  <pre><code>final List&lt;Foo&gt; foos= fooRepository.findAll(spec);
        assertThat(results, is(notNullValue()));
        assertThat(results, hasItem(hasProperty("id.fooID1", equalTo("FOOID1"))));
  </code></pre>
  
  <p>so here I want to check if in the list of foos I have a property id.fooID1 equla to FOOID1 .Here I am going one level down to check my nested property .This doesnt currently work in hamcrest and I get the following error.</p>
  
  <pre><code>java.lang.AssertionError: 
  Expected: a collection containing hasProperty("id.fooID1", "FOOID1")
       but: No property "id.fooID1"
      at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
      at org.junit.Assert.assertThat(Assert.java:956)
      at org.junit.Assert.assertThat(Assert.java:923)
  </code></pre>
  
  <p>any help or workaround on this issue .</p>