@Test
void testBuild() {

    DeploymentDescriptor deploymentDescriptor = buildDeploymentDescriptor(FOO_ID);
    ExtensionDescriptor extensionDescriptor1 = buildExtensionDescriptor(BAR_ID, FOO_ID);
    ExtensionDescriptor extensionDescriptor2 = buildExtensionDescriptor(BAZ_ID, BAR_ID);
    ExtensionDescriptor extensionDescriptor3 = buildExtensionDescriptor(QUX_ID, BAZ_ID);
    // Shuffle them around:
    List<ExtensionDescriptor> extensionDescriptors = Arrays.asList(extensionDescriptor2, extensionDescriptor3, extensionDescriptor1);
    List<ExtensionDescriptor> expectedExtensionDescriptorChain = Arrays.asList(extensionDescriptor1, extensionDescriptor2,
                                                                               extensionDescriptor3);
    ExtensionDescriptorChainBuilder extensionDescriptorChainBuilder = new ExtensionDescriptorChainBuilder();
    List<ExtensionDescriptor> extensionDescriptorChain = extensionDescriptorChainBuilder.build(deploymentDescriptor,
                                                                                               extensionDescriptors);
    assertEquals(expectedExtensionDescriptorChain, extensionDescriptorChain);
}