Skip to content

Instantly share code, notes, and snippets.

@suztomo
Created December 3, 2019 22:02
Show Gist options
  • Save suztomo/64b1ecdc0a0d670b860e7dbedb0f1fc1 to your computer and use it in GitHub Desktop.
Save suztomo/64b1ecdc0a0d670b860e7dbedb0f1fc1 to your computer and use it in GitHub Desktop.
Usage of Truth's Correspondence
@Test
public void truth() {
Truth.assertThat(ImmutableList.of(1, 2, 3)).comparingElementsUsing(
Correspondence.transforming((Integer x) -> (x % 2) == 0, "is even")).contains(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment