@Test
public void testUnexpected() {

    // Make sure the places that throw an error when given an unknown expression all do so.
    assertUnexpected(queryField("a").equalsValue(1), UnknownKeyExpression.UNKNOWN);
    assertUnexpected(queryField("a").oneOfThem().equalsValue(1), UnknownKeyExpression.UNKNOWN);
    assertUnexpected(
            queryField("p").matches(queryField("b").equalsValue(1)),
            UnknownKeyExpression.UNKNOWN);
    assertUnexpected(
            queryField("p").oneOfThem().matches(queryField("b").equalsValue(1)),
            UnknownKeyExpression.UNKNOWN);
    assertUnexpected(
            queryField("p").matches(queryField("b").equalsValue(1)),
            keyField("p").nest(UnknownKeyExpression.UNKNOWN));
    assertUnexpected(
            queryField("p").oneOfThem().matches(queryField("b").equalsValue(1)),
            keyField("p", FanType.FanOut).nest(UnknownKeyExpression.UNKNOWN));
    assertUnexpected(
            Query.and(Query.field("a").equalsValue(1), Query.field("b").equalsValue(2)),
            concat(keyField("a"), UnknownKeyExpression.UNKNOWN));
    assertUnexpected(
            new RecordTypeKeyComparison("DummyRecordType"),
            UnknownKeyExpression.UNKNOWN);
}