def test_minimize_and_maximize(self):

        class IFoo(Interface):
            price = Int

        @provides(IFoo)
        class Foo(HasTraits):
            price = Int

        # Register some objects with various prices.
        x = Foo(price=10)
        y = Foo(price=5)
        z = Foo(price=100)

        for foo in [x, y, z]:
            self.service_registry.register_service(IFoo, foo)

        # Find the service with the lowest price.
        service = self.service_registry.get_service(IFoo, minimize='price')
        self.assertNotEqual(None, service)
        self.assertEqual(Foo, type(service))
        self.assertEqual(y, service)

        # Find the service with the highest price.
        service = self.service_registry.get_service(IFoo, maximize='price')
        self.assertNotEqual(None, service)
        self.assertEqual(Foo, type(service))
        self.assertEqual(z, service)

        return


# Entry point for stand-alone testing.
Constructor.
dataset/ETHPy150Open enthought/envisage/envisage/tests/service_registry_test_case.py/ServiceRegistryTestCase.test_minimize_and_maximize--crossover with--dataset/ETHPy150Open google/mysql-tools/drift_lib/drift_policies.py/FixedUtilizationPolicy.__init__