### Question:
DatastreamHistoryLog { public InputStream toInputStream() throws IOException { try (ByteArrayOutputStream outStream = new ByteArrayOutputStream()) { new XMLOutputter(Format.getPrettyFormat()).output(historyDoc, outStream); return new ByteArrayInputStream(outStream.toByteArray()); } } DatastreamHistoryLog(PID datastreamPid);  DatastreamHistoryLog(PID datastreamPid, InputStream logStream); void addVersion(InputStream content, String contentType, Date created); InputStream toInputStream(); static final String HISTORY_TAG; static final String VERSION_TAG; static final String ID_ATTR; static final String CONTENT_TYPE_ATTR; static final String CREATED_ATTR; }### Answer:
@Test public void newLog_NoVersions() throws Exception { DatastreamHistoryLog historyLog = new DatastreamHistoryLog(dsPid); Document logDoc = inputStreamToDocument(historyLog.toInputStream()); assertLogObjectIdEquals(dsPid, logDoc); List<Element> versions = logDoc.getRootElement().getChildren(DatastreamHistoryLog.VERSION_TAG); assertEquals(0, versions.size()); }