### Question:
DumpClusterState { void dump() throws IOException { SimpleStorage<MemberId> memberIdStorage = new SimpleFileStorage<>( fs, clusterStateDirectory, CORE_MEMBER_ID_NAME, new Marshal(), NullLogProvider.getInstance() ); if ( memberIdStorage.exists() ) { MemberId memberId = memberIdStorage.readState(); out.println( CORE_MEMBER_ID_NAME + ": " + memberId ); } dumpState( LAST_FLUSHED_NAME, new LongIndexMarshal() ); dumpState( LOCK_TOKEN_NAME, new ReplicatedLockTokenState.Marshal( new Marshal() ) ); dumpState( ID_ALLOCATION_NAME, new IdAllocationState.Marshal() ); dumpState( SESSION_TRACKER_NAME, new GlobalSessionTrackerState.Marshal( new Marshal() ) ); dumpState( RAFT_MEMBERSHIP_NAME, new RaftMembershipState.Marshal() ); dumpState( RAFT_TERM_NAME, new TermState.Marshal() ); dumpState( RAFT_VOTE_NAME, new VoteState.Marshal( new Marshal() ) ); } DumpClusterState( FileSystemAbstraction fs, File dataDirectory, PrintStream out ); static void main( String[] args );  }### Answer:
@Test public void shouldDumpClusterState() throws Exception { createStates(); ByteArrayOutputStream out = new ByteArrayOutputStream(); DumpClusterState dumpTool = new DumpClusterState( fsa.get(), dataDir, new PrintStream( out ) ); dumpTool.dump(); int lineCount = out.toString().split( System.lineSeparator() ).length; assertEquals( 8, lineCount ); }