def test_flatMap(self): self.assertEqual(sources.flatMap().max(), 6)
def test_flatMap(self): self.assertTrue(sources.flatMap().any_matches(lambda k: k - 2 == 0))
def test_flatMap(self): self.assertEqual(sources.flatMap().first(), 1)
def test_flatMap(self): self.assertTupleEqual(sources.flatMap().statistics(), NumberStatistics(21, 6, 1, 6, 3.5))
def test_flatMap(self): self.assertEqual(sources.flatMap().average(), 3.5)
def test_flatMap(self): self.assertEqual(sources.flatMap().join(', '), '1, 2, 3, 4, 5, 6')
def test_flatMap(self): self.assertListEqual(sources.flatMap().to_list(), [1, 2, 3, 4, 5, 6])
def test_flatMap(self): self.assertEqual(sources.flatMap().sum(), 21)
def test_flatMap(self): self.assertListEqual(sources.flatMap().chunk(4).to_list(), [[1, 2, 3, 4], [5, 6]])
def test_flatMap(self): self.assertFalse(sources.flatMap().all_matches(lambda k: k - 2 == 0))
def test_flatMap_handling_duplicates(self): self.assertDictEqual( sources.flatMap().to_dictionary(lambda _: 0, lambda k: k, lambda k, oldValue, _: oldValue), {0: 1})
def test_flatMap(self): self.assertListEqual(forEachOpHelper(sources.flatMap()), [1, 2, 3, 4, 5, 6])