public void testDeactivatesListenerOnQueryChangeAndActivatesValidOne() {
QueryNotifier notifier = new QueryNotifier();
QueryListener listener = mock( QueryListener.class );
QueryListener listener2 = mock( QueryListener.class );
QueryImpl query = new QueryImpl( new MaxWidthCondition( px( 100 ) ) );
QueryImpl query2 = new QueryImpl( new MinWidthCondition( px( 101 ) ) );
notifier.addQueryListener( query, listener );
notifier.addQueryListener( query2, listener2 );
notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 99, 0 ) ) );
notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 199, 0 ) ) );