### Question:
Bitstream extends DSpaceObject { public InputStream retrieve() throws IOException, SQLException, AuthorizeException { if (!bContext.ignoreAuthorization()) { AuthorizeManager.authorizeAction(bContext, this, Constants.READ); } return BitstreamStorageManager.retrieve(bContext, bRow .getIntColumn("bitstream_id")); } Bitstream(Context context, TableRow row); static Bitstream find(Context context, int id); static Bitstream[] findAll(Context context); int getID(); String getHandle(); int getSequenceID(); void setSequenceID(int sid); String getName(); void setName(String n); String getSource(); void setSource(String n); String getDescription(); void setDescription(String n); String getChecksum(); String getChecksumAlgorithm(); long getSize(); void setUserFormatDescription(String desc); String getUserFormatDescription(); String getFormatDescription(); BitstreamFormat getFormat(); void setFormat(BitstreamFormat f); void update(); boolean isDeleted(); InputStream retrieve(); Bundle[] getBundles(); int getType(); boolean isRegisteredBitstream(); int getStoreNumber(); DSpaceObject getParentObject(); String get_internal_id();  }### Answer:
@Test public void testRetrieveCanRead() throws IOException, SQLException, AuthorizeException { new NonStrictExpectations() { AuthorizeManager authManager; { AuthorizeManager.authorizeAction((Context) any, (Bitstream) any, Constants.READ); result = null; } }; assertThat("testRetrieveCanRead 0", bs.retrieve(), notNullValue()); }
@Test(expected=AuthorizeException.class) public void testRetrieveNoRead() throws IOException, SQLException, AuthorizeException { new NonStrictExpectations() { AuthorizeManager authManager; { AuthorizeManager.authorizeAction((Context) any, (Bitstream) any, Constants.READ); result = new AuthorizeException(); } }; assertThat("testRetrieveNoRead 0", bs.retrieve(), notNullValue()); }