void (boolean async) { try { final Semaphore s = new Semaphore(1); s.acquire(); VirtualFileManager fm = VirtualFileManager.getInstance(); if (async) { fm.asyncRefresh(s::release); } else { try { fm.syncRefresh(); } finally { s.release(); } } assertTrue(s.tryAcquire(1, TimeUnit.MINUTES)); } catch (InterruptedException e) { throw new RuntimeException(e); } }