### Question:
YamlAndRoleAuditFilter implements AuditFilter { @Override public boolean isWhitelisted(AuditEntry logEntry) { return yamlFilter.isWhitelisted(logEntry) || roleFilter.isWhitelisted(logEntry); } YamlAndRoleAuditFilter(AuditConfig auditConfig); @VisibleForTesting  YamlAndRoleAuditFilter(YamlAuditFilter yamlFilter, RoleAuditFilter roleFilter); @Override boolean isWhitelisted(AuditEntry logEntry); @Override void setup();  }### Answer:
@Test public void testFilteredByBothResultInFiltered() { when(yamlFilter.isWhitelisted(eq(auditEntry))).thenReturn(true); assertThat(combinedFilter.isWhitelisted(auditEntry)).isEqualTo(true); }
@Test public void testFilteredByYamlOnlyResultInFiltered() { when(yamlFilter.isWhitelisted(eq(auditEntry))).thenReturn(true); assertThat(combinedFilter.isWhitelisted(auditEntry)).isEqualTo(true); }
@Test public void testFilteredByRoleOnlyResultInFiltered() { when(yamlFilter.isWhitelisted(eq(auditEntry))).thenReturn(false); when(roleFilter.isWhitelisted(eq(auditEntry))).thenReturn(true); assertThat(combinedFilter.isWhitelisted(auditEntry)).isEqualTo(true); }
@Test public void testFilteredByNoneResultInNotFiltered() { when(yamlFilter.isWhitelisted(eq(auditEntry))).thenReturn(false); when(roleFilter.isWhitelisted(eq(auditEntry))).thenReturn(false); assertThat(combinedFilter.isWhitelisted(auditEntry)).isEqualTo(false); }