public StarMgrServer() {
        execution = new StateChangeExecution() {
            @Override
            public void transferToLeader() {
                becomeLeader();
            }

            @Override
            public void transferToNonLeader(FrontendNodeType newType) {
                becomeFollower();
            }
        };
    }
@Test
    public void testStarMgrServer() throws Exception {
        StarMgrServer server = new StarMgrServer();

        new MockUp<StarManagerServer>() {
            @Mock
            public void start(int port) throws IOException {
            }
        };

        server.initialize(environment, tempFolder.getRoot().getPath());

        server.getJournalSystem().setReplayId(1L);
        Assert.assertEquals(1L, server.getReplayId());

        new MockUp<StarOSBDBJEJournalSystem>() {
            @Mock
            public void replayTo(long journalId) throws StarException {
            }
            @Mock
            public long getReplayId() {
                return 0;
            }
        };
        Assert.assertTrue(server.replayAndGenerateImage(tempFolder.getRoot().getPath(), 0L));

        new MockUp<StarOSBDBJEJournalSystem>() {
            @Mock
            public void replayTo(long journalId) throws StarException {
            }
            @Mock
            public long getReplayId() {
                return 1;
            }
        };
        Assert.assertTrue(server.replayAndGenerateImage(tempFolder.getRoot().getPath(), 1L));
    }