### Question:
FilePremisLogger implements PremisLogger { @Override public PremisEventBuilder buildEvent(PID eventPid, Resource eventType, Date date) { if (eventPid == null) { eventPid = pidMinter.mintPremisEventPid(objectPid); } if (date == null) { date = new Date(); } return new PremisEventBuilder(objectPid, eventPid, eventType, date, this); } FilePremisLogger(PID pid, File file, RepositoryPIDMinter pidMinter); @Override PremisEventBuilder buildEvent(PID eventPid, Resource eventType, Date date); @Override PremisEventBuilder buildEvent(Resource eventType); @Override PremisLogger writeEvents(Resource... eventResources); @Override PremisLogger createLog(InputStream contentStream); Model getModel(); @Override Model getEventsModel(); @Override void close(); @Override boolean isClosed();  }### Answer:
@Test public void testEventbuilderCreation() { PremisEventBuilder builder = premis.buildEvent(null, eventType, date); assertTrue("Returned object is not a PremisLogger", premis instanceof PremisLogger); assertTrue("Returned object is not a PremisEventBuilder", builder instanceof PremisEventBuilder); }
@Test public void testMultipleEvents() throws Exception { PID agentPid1 = AgentPids.forPerson("agent1"); Resource event1 = premis.buildEvent(null, Premis.Normalization, date) .addEventDetail("Event 1") .addAuthorizingAgent(agentPid1) .write(); PID agentPid2 = AgentPids.forSoftware(SoftwareAgent.clamav); Resource event2 = premis.buildEvent(null, Premis.VirusCheck, date) .addEventDetail("Event 2") .addSoftwareAgent(agentPid2) .write(); InputStream in = new FileInputStream(premisFile); Model model = ModelFactory.createDefaultModel().read(in, null, "N-TRIPLES"); Resource resc1 = model.getResource(event1.getURI()); Resource resc2 = model.getResource(event2.getURI()); assertNotEquals("Events must have separate uris", resc1, resc2); assertEquals("Normalization type not written to file", Premis.Normalization, resc1.getProperty(RDF.type).getObject()); assertEquals("Event detail not written to file", "Event 1", resc1.getProperty(Premis.note).getObject().toString()); assertEquals("Authorizing agent not written to file", agentPid1.getRepositoryPath(), resc1.getProperty(Premis.hasEventRelatedAgentAuthorizor).getResource().getURI()); assertEquals("VirusCheck type not written to file", Premis.VirusCheck, resc2.getProperty(RDF.type).getObject()); assertEquals("Event detail not written to file", "Event 2", resc2.getProperty(Premis.note).getObject().toString()); assertEquals("Related agent not written to file", agentPid2.getRepositoryPath(), resc2.getProperty(Premis.hasEventRelatedAgentExecutor).getResource().getURI()); Resource objResc = model.getResource(pid.getRepositoryPath()); assertTrue(objResc.hasProperty(RDF.type, Premis.Representation)); assertTrue(resc1.hasProperty(Prov.used, objResc)); assertTrue(resc2.hasProperty(Prov.used, objResc)); }