### Question:
CompositeBlobDetailsFilter implements BlobDetailsFilter { public List<BlobDetails> filter(final List<BlobDetails> objects) { if (objects == null) { return null; } List<BlobDetails> accepted = new ArrayList<BlobDetails>(objects); for (int i = 0; i < blobDetailsFilters.size() && !accepted.isEmpty(); i++) { accepted = blobDetailsFilters.get(0).filter(accepted); } return accepted; } CompositeBlobDetailsFilter(BlobDetailsFilter... blobDetailsFilters);  CompositeBlobDetailsFilter(Collection<BlobDetailsFilter> blobDetailsFilters); CompositeBlobDetailsFilter addFilter(BlobDetailsFilter... filters); CompositeBlobDetailsFilter addFilters(Collection<BlobDetailsFilter> filtersToAdd); List<BlobDetails> filter(final List<BlobDetails> objects);  }### Answer:
@Test public void testForwardedToFilters() throws Exception { CompositeBlobDetailsFilter compositeBlobDetailsFilter = new CompositeBlobDetailsFilter(mockBlobDetailsFilter1, mockBlobDetailsFilter2); List<BlobDetails> returnedObjects = Arrays.asList(new BlobDetails[] { mockBlobDetails }); when(mockBlobDetailsFilter1.filter(anyListOf(BlobDetails.class))).thenReturn(returnedObjects); when(mockBlobDetailsFilter2.filter(anyListOf(BlobDetails.class))).thenReturn(returnedObjects); assertEquals(returnedObjects, compositeBlobDetailsFilter.filter(Arrays .asList(new BlobDetails[] { mockBlobDetails }))); }
@Test public void testNegative() throws Exception { CompositeBlobDetailsFilter compositeBlobDetailsFilter = new CompositeBlobDetailsFilter(mockBlobDetailsFilter1, mockBlobDetailsFilter2); when(mockBlobDetailsFilter1.filter(anyListOf(BlobDetails.class))).thenReturn(new ArrayList<BlobDetails>(0)); when(mockBlobDetailsFilter2.filter(anyListOf(BlobDetails.class))).thenReturn(new ArrayList<BlobDetails>(0)); assertTrue(compositeBlobDetailsFilter.filter(Arrays.asList(new BlobDetails[] { mockBlobDetails })).isEmpty()); }