def test_distinct_with_numbers(self): self.assertDictEqual( sources.distinctNumbers().to_dictionary(lambda k: k, lambda k: k), { 0: 0, 2: 2, 5: 5, 10: 10 })
def test_distinct_with_numbers(self): self.assertEqual(sources.distinctNumbers().max(), 10)
def test_distinct_with_numbers(self): self.assertEqual(sources.distinctNumbers().first(), 0)
def test_distinct_with_numbers(self): self.assertFalse(sources.distinctNumbers().any_matches(lambda k: k < 0))
def test_distinct_with_numbers(self): self.assertEqual(sources.distinctNumbers().average(), 4.25)
def test_distinct_with_numbers(self): self.assertTupleEqual(sources.distinctNumbers().statistics(), NumberStatistics(17, 4, 0, 10, 4.25))
def test_distinct_with_numbers(self): self.assertListEqual(sources.distinctNumbers().to_list(), [0, 2, 5, 10])
def test_distinct_with_numbers(self): self.assertEqual(sources.distinctNumbers().join('x'), '0x2x5x10')
def test_distinct_with_numbers(self): self.assertListEqual(forEachOpHelper(sources.distinctNumbers()), [0, 2, 5, 10])