@Test
public void testParseServiceAndAnonymousServiceParent()
{

    List<CheckReference<?>> refs = VirtualCheckExpressionParser.parseParentsExpression("service 'ping', service 'ping' on host 'default_gateway', service 'ping'");
    assertThat(refs, is(notNullValue()));
    assertThat(refs.size(), is(equalTo(3)));
    assertThat(refs.get(0), is(notNullValue()));
    assertThat(refs.get(0), is(instanceOf(AnonymousService.class)));
    assertThat(refs.get(0), is(hasProperty("name", equalTo("ping"))));
    assertThat(refs.get(1), is(notNullValue()));
    assertThat(refs.get(1), is(instanceOf(ServiceByName.class)));
    assertThat(refs.get(1), is(hasProperty("name", equalTo("ping"))));
    assertThat(refs.get(1), is(hasProperty("host", is(instanceOf(HostByName.class)))));
    assertThat(refs.get(1), is(hasProperty("host", hasProperty("name", equalTo("default_gateway")))));
    assertThat(refs.get(2), is(notNullValue()));
    assertThat(refs.get(2), is(instanceOf(AnonymousService.class)));
    assertThat(refs.get(2), is(hasProperty("name", equalTo("ping"))));
}