@Test
public void testParseTrapAndAnonymousTrapParent()
{

    List<CheckReference<?>> refs = VirtualCheckExpressionParser.parseParentsExpression("trap 'port_1', trap 'port_2' on host 'sw1', trap 'port_3'");
    assertThat(refs, is(notNullValue()));
    assertThat(refs.size(), is(equalTo(3)));
    assertThat(refs.get(0), is(notNullValue()));
    assertThat(refs.get(0), is(instanceOf(AnonymousTrap.class)));
    assertThat(refs.get(0), is(hasProperty("name", equalTo("port_1"))));
    assertThat(refs.get(1), is(notNullValue()));
    assertThat(refs.get(1), is(instanceOf(TrapByName.class)));
    assertThat(refs.get(1), is(hasProperty("name", equalTo("port_2"))));
    assertThat(refs.get(1), is(hasProperty("host", is(instanceOf(HostByName.class)))));
    assertThat(refs.get(1), is(hasProperty("host", hasProperty("name", equalTo("sw1")))));
    assertThat(refs.get(2), is(notNullValue()));
    assertThat(refs.get(2), is(instanceOf(AnonymousTrap.class)));
    assertThat(refs.get(2), is(hasProperty("name", equalTo("port_3"))));
}