### Question:
WampPublisher { public <T> void publishToAll(String topic, @Nullable T... arguments) { publish(publishMessageBuilder(topic).arguments(CollectionHelper.toList(arguments)) .build()); } WampPublisher(MessageChannel clientInboundChannel); void publish(PublishMessage publishMessage); void publishToAll(String topic, @Nullable T... arguments); void publishToAll(String topic, @Nullable Collection<T> arguments); void publishToAll(String topic, @Nullable Map<String, T> arguments); void publishTo(Collection<Long> eligibleWampSessionIds, String topic,
			@Nullable T... arguments); void publishTo(Collection<Long> eligibleWampSessionIds, String topic,
			@Nullable Collection<T> arguments); void publishTo(Collection<Long> eligibleWampSessionIds, String topic,
			@Nullable Map<String, T> arguments); void publishTo(long eligibleWampSessionId, String topic,
			@Nullable T... arguments); void publishTo(long eligibleWampSessionId, String topic,
			@Nullable Collection<T> arguments); void publishTo(long eligibleWampSessionId, String topic,
			@Nullable Map<String, T> arguments); void publishToAllExcept(Collection<Long> excludeWampSessionIds,
			String topic, @Nullable T... arguments); void publishToAllExcept(Collection<Long> excludeWampSessionIds,
			String topic, @Nullable Collection<T> arguments); void publishToAllExcept(Collection<Long> excludeWampSessionIds,
			String topic, @Nullable Map<String, T> arguments); void publishToAllExcept(long excludeWampSessionId, String topic,
			@Nullable T... arguments); void publishToAllExcept(long excludeWampSessionId, String topic,
			@Nullable Collection<T> arguments); void publishToAllExcept(long excludeWampSessionId, String topic,
			@Nullable Map<String, T> arguments); Builder publishMessageBuilder(String topic);  }### Answer:
@Test public void testPublishToAll() { this.wampPublisher.publishToAll("topic", 1); Mockito.verify(this.clientOutboundChannel, Mockito.times(1)) .send(this.messageCaptor.capture()); PublishMessage publishMessage = this.messageCaptor.getValue(); assertPublishMessage(publishMessage, "topic", Collections.singletonList(1), null, null); }
@Test public void testPublishToAllList() { List<String> value = Arrays.asList("a", "b", "c"); this.wampPublisher.publishToAll("topic2", value); Mockito.verify(this.clientOutboundChannel, Mockito.times(1)) .send(this.messageCaptor.capture()); PublishMessage publishMessage = this.messageCaptor.getValue(); assertPublishMessage(publishMessage, "topic2", value, null, null); }
@Test public void testPublishToAllMap() { Map<String, Integer> mapValue = new HashMap<>(); mapValue.put("one", 1); mapValue.put("two", 2); mapValue.put("three", 3); this.wampPublisher.publishToAll("topic3", mapValue); Mockito.verify(this.clientOutboundChannel, Mockito.times(1)) .send(this.messageCaptor.capture()); PublishMessage publishMessage = this.messageCaptor.getValue(); assertPublishMessage(publishMessage, "topic3", mapValue, null, null); }