@Test
public void getChild() {

    final QueryComponent fieldA = Query.field("a").equalsValue("dummy_value");
    FilterSatisfiedMask fieldAMask = FilterSatisfiedMask.of(fieldA);
    assertThrows(FilterSatisfiedMask.FilterNotFoundException.class,
            () -> fieldAMask.getChild(Query.field("b").equalsValue("blah")));
    final QueryComponent nestedFieldB = Query.field("b").matches(fieldA);
    FilterSatisfiedMask nestedFieldBMask = FilterSatisfiedMask.of(nestedFieldB);
    assertSame(fieldA, nestedFieldBMask.getChild(fieldA).getFilter());
    assertThrows(FilterSatisfiedMask.FilterNotFoundException.class,
            () -> nestedFieldBMask.getChild(Query.field("a").equalsValue("dummy_value")));
    final QueryComponent andComponent = Query.and(nestedFieldB, Query.field("c").equalsValue("something_else"));
    FilterSatisfiedMask andMask = FilterSatisfiedMask.of(andComponent);
    assertSame(nestedFieldB, andMask.getChild(nestedFieldB).getFilter());
    assertThrows(FilterSatisfiedMask.FilterNotFoundException.class,
            () -> andMask.getChild(Query.field("c").equalsValue("something_else")));
}