### Question:
InstallItem { public static String getBitstreamProvenanceMessage(Item myitem) throws SQLException { Bitstream[] bitstreams = myitem.getNonInternalBitstreams(); StringBuilder myMessage = new StringBuilder(); myMessage.append("No. of bitstreams: ").append(bitstreams.length).append("\n"); for (int j = 0; j < bitstreams.length; j++) { myMessage.append(bitstreams[j].getName()).append(": ") .append(bitstreams[j].getSize()).append(" bytes, checksum: ") .append(bitstreams[j].getChecksum()).append(" (") .append(bitstreams[j].getChecksumAlgorithm()).append(")\n"); } return myMessage.toString(); }  static Item installItem(Context c, InProgressSubmission is); static Item installItem(Context c, InProgressSubmission is,
            String suppliedHandle); static Item restoreItem(Context c, InProgressSubmission is,
            String suppliedHandle); static String getBitstreamProvenanceMessage(Item myitem);  }### Answer:
@Test public void testGetBitstreamProvenanceMessage() throws Exception { File f = new File(testProps.get("test.bitstream").toString()); context.turnOffAuthorisationSystem(); Item item = Item.create(context); context.commit(); Bitstream one = item.createSingleBitstream(new FileInputStream(f)); one.setName("one"); context.commit(); Bitstream two = item.createSingleBitstream(new FileInputStream(f)); two.setName("two"); context.commit(); context.restoreAuthSystemState(); String testMessage = "No. of bitstreams: 2\n"; testMessage += "one: " + one.getSize() + " bytes, checksum: " + one.getChecksum() + " (" + one.getChecksumAlgorithm() + ")\n"; testMessage += "two: " + two.getSize() + " bytes, checksum: " + two.getChecksum() + " (" + two.getChecksumAlgorithm() + ")\n"; assertThat("testGetBitstreamProvenanceMessage 0", InstallItem.getBitstreamProvenanceMessage(item), equalTo(testMessage)); }