@@ -0,0 +1,1185 @@
+package com.github.rschmitt.dynamicobject;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport java.util.UUID;%0D%0Aimport java.util.function.BiFunction;%0D%0A%0D%0Aimport static com.github.rschmitt.dynamicobject.DynamicObject.deserialize;%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0A%0D%0Apublic class MethodHandleTest %7B%0D%0A    private static final UUID RECEIPT_HANDLE = UUID.randomUUID();%0D%0A%0D%0A    @Test%0D%0A    public void buildPolymorphically() %7B%0D%0A        String edn = %22%7B:command %5C%22start the reactor%5C%22%7D%22;%0D%0A%0D%0A        QueueMessage queueMessage = deserializeAndAttachMetadata(edn, QueueMessage::receiptHandle, QueueMessage.class);%0D%0A%0D%0A        assertEquals(RECEIPT_HANDLE, queueMessage.receiptHandle());%0D%0A        assertEquals(%22start the reactor%22, queueMessage.command());%0D%0A    %7D%0D%0A%0D%0A    private %3CT%3E T deserializeAndAttachMetadata(String edn, BiFunction%3CT, UUID, T%3E receiptHandleMetadataBuilder, Class%3CT%3E type) %7B%0D%0A        T instance = deserialize(edn, type);%0D%0A        return receiptHandleMetadataBuilder.apply(instance, RECEIPT_HANDLE);%0D%0A    %7D%0D%0A%7D%0D%0A%0D%0Ainterface QueueMessage extends DynamicObject%3CQueueMessage%3E %7B%0D%0A    String command();%0D%0A%0D%0A    @Meta UUID receiptHandle();%0D%0A    QueueMessage receiptHandle(UUID receiptHandle);%0D%0A%7D

Add MethodHandleTest