@Test
public void whenLongPollingShouldObserveItemsFromLabelColorConditions() {

    new Thread(() -> {
        try {
            Thread.sleep(STATE_UPDATE_WAIT_TIME); // wait for the #getPageData call and listeners to attach to the
                                                  // item
            labelColorItem.setState(new DecimalType(BigDecimal.ONE));
        } catch (InterruptedException e) {
        }
    }).start();
    // non-null is sufficient here.
    when(headers.getRequestHeader(HTTP_HEADER_X_ATMOSPHERE_TRANSPORT)).thenReturn(List.of());
    Response response = sitemapResource.getPageData(headers, null, SITEMAP_MODEL_NAME, SITEMAP_NAME, null, false);
    PageDTO pageDTO = (PageDTO) response.getEntity();
    assertThat(pageDTO.timeout, is(false)); // assert that the item state change did trigger the blocking method to
                                            // return
}