### Question:
Datastream { @Override public String toString() { StringBuilder sb = new StringBuilder(); if (name != null) { sb.append(name); } sb.append('|'); if (mimetype != null) { sb.append(mimetype); } sb.append('|'); if (filename != null) { sb.append(filename); } sb.append('|'); if (extension != null) { sb.append(extension); } sb.append('|'); if (filesize != null) { sb.append(filesize); } sb.append('|'); if (checksum != null) { sb.append(checksum); } sb.append('|'); if (owner != null) { sb.append(owner); } return sb.toString(); } Datastream(String owner, String name, Long filesize, String mimetype, String filename, String extension,
            String checksum);  Datastream(String datastream); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); String getDatastreamIdentifier(); String getName(); String getOwner(); Long getFilesize(); String getMimetype(); String getExtension(); String getChecksum(); String getFilename(); void setFilename(String filename); void setChecksum(String checksum); void setMimetype(String mimetype); void setExtension(String extension); void setOwner(String owner); void setFilesize(Long filesize);  }### Answer:
@Test public void testToString() { Datastream ds = new Datastream(null, "original", 555l, "text/plain", "file.txt", "txt", CHECKSUM); assertEquals("original", ds.getName()); assertEquals("text/plain", ds.getMimetype()); assertEquals("file.txt", ds.getFilename()); assertEquals("txt", ds.getExtension()); assertEquals(555, ds.getFilesize().longValue()); assertEquals(CHECKSUM, ds.getChecksum()); assertEmpty(ds.getOwner()); assertEquals("original|text/plain|file.txt|txt|555|" + CHECKSUM + "|", ds.toString()); }