@Test
public void testThingIsBeingRemoved() {

    inbox.add(DiscoveryResultBuilder.create(THING_UID).withProperty(DEVICE_ID_KEY, DEVICE_ID)
            .withRepresentationProperty(DEVICE_ID_KEY).build());
    inbox.setFlag(THING_UID, DiscoveryResultFlag.IGNORED);
    List<DiscoveryResult> results = inbox.stream().filter(withFlag(DiscoveryResultFlag.IGNORED))
            .collect(Collectors.toList());
    assertThat(results.size(), is(1));
    assertThat(results.get(0).getThingUID(), is(equalTo(THING_UID)));
    automaticInboxProcessor.removed(thing);
    results = inbox.getAll();
    assertThat(results.size(), is(0));
}