📅  最后修改于: 2022-03-11 14:52:30.088000             🧑  作者: Mango
@Test
public void createStream_whenFindAnyResultIsPresent_thenCorrect() {
List list = Arrays.asList("A","B","C","D");
Optional result = list.stream().findAny();
assertTrue(result.isPresent());
assertThat(result.get(), anyOf(is("A"), is("B"), is("C"), is("D")));
}