### Question:
PolicyFileHiveFactory implements HiveFactory { public final boolean addPolicyFile(URL file) { if (file == null) { log.warn("Can not add null as an url."); return false; } return policyFiles.add(file); } 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 testAddPolicyFile() { PolicyFileHiveFactory factory = new PolicyFileHiveFactory(Actions.getActionFactory(KEY)); factory.addPolicyFile(getClass().getResource("test-policy.hive")); try { factory.addPolicyFile(new URL("http", "localhost", "foobar")); } catch (MalformedURLException e) { fail(e.getMessage()); } factory.addPolicyFile(null); }