### Question:
TableParameterListenerEventFilter implements ListenerEventFilter { @Override public boolean isFiltered(ListenerEvent listenerEvent, LifecycleEventType lifecycleEventType) { Map<String, String> tableParameters = listenerEvent.getTableParameters(); if (tableParameters == null) { return true; } return !Boolean.parseBoolean(tableParameters.get(lifecycleEventType.getTableParameterName())); }  @Override boolean isFiltered(ListenerEvent listenerEvent, LifecycleEventType lifecycleEventType);  }### Answer:
@Test public void typicalFilterBeekeeperManaged() { when(alterPartitionEvent.getTableParameters()).thenReturn(Map.of(BEEKEEPER_TABLE_PARAMETER, BEEKEEPER_MANAGED)); Boolean filter = listenerEventFilter.isFiltered(alterPartitionEvent, UNREFERENCED); assertThat(filter).isFalse(); }
@Test public void typicalFilterNotBeekeeperManaged() { when(alterPartitionEvent.getTableParameters()).thenReturn(Map.of(BEEKEEPER_TABLE_PARAMETER, NOT_BEEKEEPER_MANAGED)); Boolean filter = listenerEventFilter.isFiltered(alterPartitionEvent, UNREFERENCED); assertThat(filter).isTrue(); }
@Test public void typicalFilterNotBeekeeperManagedEmptyMap() { when(alterPartitionEvent.getTableParameters()).thenReturn(Map.of()); Boolean filter = listenerEventFilter.isFiltered(alterPartitionEvent, UNREFERENCED); assertThat(filter).isTrue(); }
@Test public void typicalFilterNotBeekeeperManagedNullMap() { when(alterPartitionEvent.getTableParameters()).thenReturn(null); Boolean filter = listenerEventFilter.isFiltered(alterPartitionEvent, UNREFERENCED); assertThat(filter).isTrue(); }
@Test public void typicalFilterBeekeeperManagedMapWithWrongKey() { when(alterPartitionEvent.getTableParameters()).thenReturn(Map.of(NOT_BEEKEEPER_TABLE_PARAMETER, BEEKEEPER_MANAGED)); Boolean filter = listenerEventFilter.isFiltered(alterPartitionEvent, UNREFERENCED); assertThat(filter).isTrue(); }