### Question:
FactoryFactory { public ServiceFactory makeServiceFactory(String serviceId, String privateKeyPEM) { RSAPrivateKey privateKey = makePrivateKeyFromPEM(privateKeyPEM); String publicKeyFingerprint = getPublicKeyFingerprintFromPrivateKey(privateKey); Map<String, RSAPrivateKey> keys = new ConcurrentHashMap<>(); keys.put(publicKeyFingerprint, privateKey); return makeServiceFactory(serviceId, keys, publicKeyFingerprint); } FactoryFactory(
            Provider provider, HttpClient httpClient, Cache keyCache,
            String apiBaseURL, String apiIdentifier, int requestExpireSeconds,
            int offsetTTL, int currentPublicKeyTTL, EntityKeyMap entityKeyMap); ServiceFactory makeServiceFactory(String serviceId, String privateKeyPEM); ServiceFactory makeServiceFactory(String serviceId, Map<String, RSAPrivateKey> privateKeys, String currentPrivateKey); DirectoryFactory makeDirectoryFactory(String directoryId, String privateKeyPEM); DirectoryFactory makeDirectoryFactory(String directoryId, Map<String, RSAPrivateKey> privateKeys,
                                                 String currentPrivateKey); synchronized OrganizationFactory makeOrganizationFactory(String organizationId, String privateKeyPEM); synchronized OrganizationFactory makeOrganizationFactory(String organizationId,
                                                                    Map<String, RSAPrivateKey> privateKeys,
                                                                    String currentPrivateKey);  }### Answer:
@Test public void makeServiceFactoryWithKey() throws Exception { assertThat( factoryFactory.makeServiceFactory(UUID1, privateKeyPEM), instanceOf(ServiceFactory.class) ); }
@Test public void makeServiceFactoryWithKeymap() throws Exception { assertThat( factoryFactory.makeServiceFactory(UUID1, new HashMap<String, RSAPrivateKey>(), "Current key"), instanceOf(ServiceFactory.class) ); }