// mock ByteStreamManager
ByteStreamManager byteStreamManager = mock(ByteStreamManager.class);
when(byteStreamManager.load("pid")).thenReturn(content.getBytes());
// execute test
DigitalObjectManager digitalObjectManager = new DigitalObjectManager();
digitalObjectManager.setByteStreamManager(byteStreamManager);
DigitalObject resultObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(object);
// verify results
assertFalse(object == resultObject);
assertTrue(Arrays.equals(content.getBytes(), resultObject.getData().getData()));
assertEquals("pid", resultObject.getPid());