HazelcastSerializedBroadcaster extends HazelcastBroadcaster { @Override public void outgoingBroadcast(Object message) { getTopic().publish(message); }  @Override void outgoingBroadcast(Object message);  }
@Test public void test() { HazelcastSerializedBroadcaster hazelcastSerializedBroadcaster = spy(new HazelcastSerializedBroadcaster()); ITopic topic = mock(ITopic.class); when(hazelcastSerializedBroadcaster.getTopic()).thenReturn(topic); Object message = new Object(); hazelcastSerializedBroadcaster.outgoingBroadcast(message); verify(hazelcastSerializedBroadcaster,times(1)).getTopic(); verify(topic,times(1)).publish(message); }