String expectedName = "John Doe"; String actualName = getName(); assertThat(actualName, is(expectedName));
Listnames = getNames(); assertThat(names, hasItem("John Doe"));
ListThe package library for org.hamcrest Matchers is "org.hamcrest".names = getNames(); assertThat(names, hasSize(3));