def test_last_n_average_threshold(self):
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, []), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.0]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.4]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.5]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.6]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 1.0]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.2, 1.0]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.2, 1.0]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 1.0, 1.0]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.6, 0.6]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 3, [0.0, 0.6, 0.6]), True)
def test_last_n_average_threshold(self):
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, []), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.0]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.4]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.5]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.6]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 1.0]), True)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.2, 1.0]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.2, 1.0]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 1.0, 1.0]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 2, [0.0, 0.6, 0.6]), False)
    self.assertEqual(trivial.last_n_average_threshold(0.5, 3, [0.0, 0.6, 0.6]), True)