mockito stream code example Example: mock stream java when(mock.streamMethod()).thenAnswer(invocation -> Stream.of("A", "B"))