@Test
public void triggeredListenerOnGC() throws InterruptedException {

    CountDownLatch latch = new CountDownLatch(1);
    GCNotifications notif = new GCNotifications(GCNotificationsTest::handleNotification);
    notif.subscribe((t, s) -> {
        Assert.assertEquals("GC", s);
        latch.countDown();
    });
    System.gc();
    Assert.assertTrue(latch.await(200, TimeUnit.MILLISECONDS));
}