@Test
public void testMessageToAdaptable() {

    final String subject = subject();
    final String contentType = payload.contentType;
    final JsonPointer path = path(subject);
    // build expected adaptable
    final TopicPath topicPath = TopicPath.newBuilder(TestConstants.THING_ID)
            .live()
            .messages()
            .subject(subject)
            .build();
    final PayloadBuilder payloadBuilder = Payload.newBuilder(path);
    if (payload.asJson != null) {
        payloadBuilder.withValue(payload.asJson);
    }
    final Adaptable expectedAdaptable = Adaptable.newBuilder(topicPath)
            .withPayload(payloadBuilder.build())
            .withHeaders(expectedAdaptableHeaders(contentType))
            .build();
    // build the message that will be converted to an adaptable
    final MessageHeaders messageHeaders = messageHeaders(subject, contentType);
    final Message<Object> theMessage = message(messageHeaders, payload.asObject);
    final DittoHeaders theHeaders = dittoHeaders();
    final MessageCommand<?, ?> messageCommand = messageCommand(type, theMessage, theHeaders);
    // test
    final Adaptable actual = underTest.toAdaptable(messageCommand);
    assertThat(actual).isEqualTo(expectedAdaptable);
}