public synchronized BackgroundAction getCurrent() {
        final Iterator<BackgroundAction> iter = running.iterator();
        if(iter.hasNext()) {
            return iter.next();
        }
        return null;
    }
@Test
    public void testGetCurrent() throws Exception {
        BackgroundActionRegistry r = new BackgroundActionRegistry();
        final CountDownLatch lock = new CountDownLatch(1);
        final AbstractBackgroundAction action = new AbstractBackgroundAction() {
            @Override
            public Object run() {
                return null;
            }

            @Override
            public void finish() {
                super.finish();
                lock.countDown();
            }
        };
        assertTrue(r.add(action));
        action.finish();
        lock.await(1, TimeUnit.SECONDS);
        r.remove(action);
        assertFalse(r.contains(action));
        assertNull(r.getCurrent());
    }