@Test public void testBothAccept() { when(delegate1.accept(file)).thenReturn(true); when(delegate2.accept(file)).thenReturn(true); assertTrue(andFileFilter.accept(file)); verify(delegate1).accept(file); verify(delegate2).accept(file); }
@Override public boolean accept(File pathname) { for (FileFilter delegate : delegates) { if (!delegate.accept(pathname)) { return false; } } return true; }
AndFileFilter implements ParcelableFileFilter { @Override public boolean accept(File pathname) { for (FileFilter delegate : delegates) { if (!delegate.accept(pathname)) { return false; } } return true; } }
AndFileFilter implements ParcelableFileFilter { @Override public boolean accept(File pathname) { for (FileFilter delegate : delegates) { if (!delegate.accept(pathname)) { return false; } } return true; } AndFileFilter(ParcelableFileFilter... delegates); }
AndFileFilter implements ParcelableFileFilter { @Override public boolean accept(File pathname) { for (FileFilter delegate : delegates) { if (!delegate.accept(pathname)) { return false; } } return true; } AndFileFilter(ParcelableFileFilter... delegates); @Override boolean accept(File pathname); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); }
AndFileFilter implements ParcelableFileFilter { @Override public boolean accept(File pathname) { for (FileFilter delegate : delegates) { if (!delegate.accept(pathname)) { return false; } } return true; } AndFileFilter(ParcelableFileFilter... delegates); @Override boolean accept(File pathname); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final Creator<AndFileFilter> CREATOR; }