@Test
    public void testAll() throws InterruptedException {
        ScheduledService scheduledService = new ScheduledService("ttt", 12345,
            new Runnable() {
                @Override
                public void run() {
                    count.incrementAndGet();
                }
            }, 0, 100, TimeUnit.MILLISECONDS);
        scheduledService.start();
        Assert.assertFalse(scheduledService.isStarted());

        scheduledService = new ScheduledService("ttt", ScheduledService.MODE_FIXEDRATE,
            new Runnable() {
                @Override
                public void run() {
                    count.incrementAndGet();
                }
            }, 0, 100, TimeUnit.MILLISECONDS);
        scheduledService.start();
        Assert.assertTrue(scheduledService.isStarted());
        scheduledService.start();
        Assert.assertTrue(scheduledService.isStarted());
        Thread.sleep(300);
        Assert.assertTrue(count.get() > 0);

        ScheduledService.reset();
        Assert.assertTrue(scheduledService.isStarted());
        Assert.assertFalse(ScheduledService.isResetting());

        scheduledService.shutdown();
        Assert.assertFalse(scheduledService.isStarted());
        scheduledService.stop();
        Assert.assertFalse(scheduledService.isStarted());
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/api/src/test/java/com/alipay/sofa/rpc/common/struct/ScheduledServiceTest.java