public static FieldScope allowingFields(int firstFieldNumber, int... rest) {
    return FieldScopeImpl.createAllowingFields(asList(firstFieldNumber, rest));
  }
@Test
  public void testIgnoringTopLevelAnyField_fieldScopes_allowingFields() {
    String typeUrl =
        isProto3()
            ? "type.googleapis.com/com.google.common.truth.extensions.proto.SubTestMessage3"
            : "type.googleapis.com/com.google.common.truth.extensions.proto.SubTestMessage2";
    Message message =
        parse("o_int: 1 o_any_message { [" + typeUrl + "]: { o_int: 2 r_string: \"foo\" } }");
    Message diffMessage = parse("o_int: 1");
    int goodFieldNumber = getFieldNumber("o_int");

    expectThat(message)
        .withPartialScope(FieldScopes.allowingFields(goodFieldNumber))
        .isEqualTo(diffMessage);
  }