Bundle extends DSpaceObject implements DSpaceObjectLegacySupport { public List<Bitstream> getBitstreams() { List<Bitstream> bitstreamList = new LinkedList<>(this.bitstreams); return bitstreamList; } protected  Bundle(); @Override Integer getLegacyId(); @Override String getName(); void setName(Context context, String name); Bitstream getPrimaryBitstream(); void setPrimaryBitstreamID(Bitstream bitstream); void unsetPrimaryBitstreamID(); List<Bitstream> getBitstreams(); void clearBitstreams(); void removeBitstream(Bitstream bitstream); List<Item> getItems(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int getType();  }
@Test public void testGetBitstreams() throws FileNotFoundException, SQLException, IOException, AuthorizeException { new NonStrictExpectations(authorizeService.getClass()) {{ authorizeService.authorizeAction((Context) any, (Bundle) any, Constants.ADD); result = null; authorizeService.authorizeAction((Context) any, (Bitstream) any, Constants.WRITE); result = null; }}; assertThat("testGetBitstreams 0", b.getBitstreams(), notNullValue()); assertThat("testGetBitstreams 1", b.getBitstreams().size(), equalTo(0)); String name = "name"; File f = new File(testProps.get("test.bitstream").toString()); Bitstream bs = bitstreamService.create(context, new FileInputStream(f)); bs.setName(context, name); bundleService.addBitstream(context, b, bs); assertThat("testGetBitstreams 2", b.getBitstreams(), notNullValue()); assertThat("testGetBitstreams 3", b.getBitstreams().size(), equalTo(1)); assertThat("testGetBitstreams 4", b.getBitstreams().get(0).getName(), equalTo(name)); }