### Question:
PolicyFileHiveFactory implements HiveFactory { public final Hive createHive() { BasicHive hive = constructHive(); boolean readAnything = false; for (URL file : policyFiles) { readAnything = true; try { readPolicyFile(file, hive); } catch (IOException e) { log.error("Could not read from " + file, e); } } for (InputStream stream : inputStreams) { readAnything = true; try { readInputStream(stream, hive); } catch (IOException e) { log.error("Could not read from stream", e); } } inputStreams.clear(); for (Reader stream : inputReaders) { readAnything = true; try { readInputReader(stream, hive); } catch (IOException e) { log.error("Could not read from reader", e); } } inputReaders.clear(); if (!readAnything) log.warn("No policyFiles or inputstreams were added to the factory!"); hive.lock(); return hive; } PolicyFileHiveFactory(ActionFactory actionFactory); final boolean addPolicyFile(URL file); final boolean addStream(InputStream stream); final boolean addReader(Reader input); final String getAlias(String key); final String setAlias(String key, String value); final Hive createHive(); final boolean isUsingHiveCache(); final void useHiveCache(boolean useCache); final boolean isCloseInputStreams(); final void setCloseInputStreams(boolean closeInputStreams);  }### Answer:
@Test public void testCreateHive() { PolicyFileHiveFactory factory = new PolicyFileHiveFactory(Actions.getActionFactory(KEY)); factory.addPolicyFile(getClass().getResource("test-policy.hive")); doCreateHive(factory); }