@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 }))); }
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 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 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 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); }
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);  }