@Test
public void testPublisherCallsCorrectDoPublishWhenNoKeysAreProvided() {

  boolean[] doPublishNothingWasCalled = {false};
  final DoubleMapPublisher doubleMapPublisher =
      new DoubleMapPublisher(new HashSet<>()) {
        @Override
        protected void doPublish() {
          doPublishNothingWasCalled[0] = true;
        }
        @Override
        protected void doPublish(Map<String, Double> publishMap) {
          fail(SHOULD_NOT_HAVE_BEEN_CALLED);
        }
        @Override
        protected void doPublishSingle(Double value) {
          fail(SHOULD_NOT_HAVE_BEEN_CALLED);
        }
      };
  doubleMapPublisher.setName("Don't care");
  doubleMapPublisher.publish(new HashMap<>());
  assertTrue("doPublish should have been called", doPublishNothingWasCalled[0]);
}