### Question:
MqttProtocolClient implements ProtocolClient { @Override public CompletableFuture<Content> invokeResource(Form form) { return invokeResource(form, null); } MqttProtocolClient(Pair<MqttProtocolSettings, MqttClient> settingsClientPair);   MqttProtocolClient(Pair<MqttProtocolSettings, MqttClient> settingsClientPair,
                       Map<String, Observable<Content>> topicSubjects); @Override CompletableFuture<Content> invokeResource(Form form); @Override CompletableFuture<Content> invokeResource(Form form, Content content); @Override Observable<Content> observeResource(Form form); @Override Observable<Thing> discover(ThingFilter filter);  }### Answer:
@Test public void invokeResourceShouldPublishNullToBroker() throws MqttException { when(form.getHref()).thenReturn("tcp: client = new MqttProtocolClient(new Pair(settings, mqttClient), topicSubjects); client.invokeResource(form); verify(mqttClient).publish(eq("counter/actions/increment"), argThat(new MqttMessageMatcher(new MqttMessage(new byte[0])))); }
@Test public void invokeResourceWithContentShouldGivenContentToBroker() throws MqttException { when(form.getHref()).thenReturn("tcp: when(content.getBody()).thenReturn("Hallo Welt".getBytes()); client = new MqttProtocolClient(new Pair(settings, mqttClient), topicSubjects); client.invokeResource(form, content); verify(mqttClient).publish(eq("counter/actions/increment"), argThat(new MqttMessageMatcher(new MqttMessage("Hallo Welt".getBytes())))); }