You can merge this two lines: assertThat(values, contains("andromeda"));