public static FieldScope fromSetFields(Message message) {
    return fromSetFields(
        message, AnyUtils.defaultTypeRegistry(), AnyUtils.defaultExtensionRegistry());
  }
@Test
  public void testFromSetFields_iterables_vacuousIfEmptyOrAllNull() {
    Message message1 = parse("o_int: 1 r_string: \"foo\" r_string: \"bar\"");
    Message eqIgnoredMessage1 = parse("o_int: 2 r_string: \"foo\" r_string: \"bar\"");
    Message message2 = parse("o_int: 3 r_string: \"baz\" r_string: \"qux\"");
    Message eqIgnoredMessage2 = parse("o_int: 4 r_string: \"baz\" r_string: \"qux\"");

    List<Message> messages = Lists.newArrayList();
    messages.add(null);
    messages.add(null);

    expectThat(listOf(message1, message2))
        .withPartialScope(FieldScopes.fromSetFields(ImmutableList.<Message>of()))
        .containsExactly(eqIgnoredMessage1, eqIgnoredMessage2);
    expectThat(listOf(message1, message2))
        .withPartialScope(FieldScopes.fromSetFields(messages))
        .containsExactly(eqIgnoredMessage1, eqIgnoredMessage2);

    expectFailureWhenTesting()
        .that(listOf(message1, message2))
        .withPartialScope(FieldScopes.fromSetFields(ImmutableList.<Message>of()))
        .containsNoneOf(eqIgnoredMessage1, eqIgnoredMessage2);

    expectFailureWhenTesting()
        .that(listOf(message1, message2))
        .withPartialScope(FieldScopes.fromSetFields(messages))
        .containsNoneOf(eqIgnoredMessage1, eqIgnoredMessage2);
    expectThatFailure().isNotNull();
  }