### Question:
TrustManagerHeaplet extends GenericHeaplet { @Override public Object create() throws HeapException { JsonValue storeRef = config.get("keystore").required(); KeyStore keyStore = heap.resolve(storeRef, KeyStore.class); String algorithm = config.get("alg").defaultTo(TrustManagerFactory.getDefaultAlgorithm()).asString(); TrustManagerFactory factory; try { factory = TrustManagerFactory.getInstance(algorithm); factory.init(keyStore); } catch (Exception e) { throw new HeapException(loadingError(algorithm, storeRef), e); } TrustManager[] managers = factory.getTrustManagers(); if (managers.length == 1) { return managers[0]; } else if (managers.length > 1) { logger.warning("Only the first TrustManager will be selected"); return managers[0]; } throw new HeapException(loadingError(algorithm, storeRef)); }  @Override Object create();  }### Answer:
@Test public void shouldLoadTrustManagerWithDefaultAlgorithm() throws Exception { HeapImpl heap = new HeapImpl(Name.of("anonymous")); heap.put("KeyStore", loadKeyStore("jks", "/x509cert-keystore.jks")); JsonValue config = json(object( field("keystore", "KeyStore") )); TrustManagerHeaplet heaplet = new TrustManagerHeaplet(); assertThat(heaplet.create(Name.of(OBJECT_NAME), config, heap)) .isNotNull() .isInstanceOf(TrustManager.class); }