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