@Override
    public void configure(Binder binder) {
      HostComponentUpdateEventPublisher hostComponentUpdateEventPublisher =
          EasyMock.createNiceMock(HostComponentUpdateEventPublisher.class);
      RequestUpdateEventPublisher requestUpdateEventPublisher =
          EasyMock.createNiceMock(RequestUpdateEventPublisher.class);
      ServiceUpdateEventPublisher serviceUpdateEventPublisher =
          EasyMock.createNiceMock(ServiceUpdateEventPublisher.class);

      binder.bind(HostComponentUpdateEventPublisher.class).toInstance(hostComponentUpdateEventPublisher);
      binder.bind(RequestUpdateEventPublisher.class).toInstance(requestUpdateEventPublisher);
      binder.bind(ServiceUpdateEventPublisher.class).toInstance(serviceUpdateEventPublisher);
    }
Tests that JPA does the sorting work for us.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java