### Question:
FactoryFactory { public DirectoryFactory makeDirectoryFactory(String directoryId, String privateKeyPEM) { RSAPrivateKey privateKey = makePrivateKeyFromPEM(privateKeyPEM); String publicKeyFingerprint = getPublicKeyFingerprintFromPrivateKey(privateKey); Map<String, RSAPrivateKey> keys = new ConcurrentHashMap<>(); keys.put(publicKeyFingerprint, privateKey); return makeDirectoryFactory(directoryId, 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(expected = IllegalArgumentException.class) public void makeDirectoryFactoryWithNullUUIDThrowsIllegalArgument() throws Exception { factoryFactory.makeDirectoryFactory(null, privateKeyPEM); }
@Test public void makeDirectoryFactoryWithKey() throws Exception { assertThat( factoryFactory.makeDirectoryFactory(UUID1, privateKeyPEM), instanceOf(DirectoryFactory.class) ); }
@Test public void makeDirectoryFactoryWithKeymap() throws Exception { assertThat( factoryFactory.makeDirectoryFactory(UUID1, new HashMap<String, RSAPrivateKey>(), "Current key"), instanceOf(DirectoryFactory.class) ); }