### Question:
CommunityCommitProcessFactory implements CommitProcessFactory { @Override public TransactionCommitProcess create( TransactionAppender appender, StorageEngine storageEngine, Config config ) { if ( config.get( GraphDatabaseSettings.read_only ) ) { return new ReadOnlyTransactionCommitProcess(); } return new TransactionRepresentationCommitProcess( appender, storageEngine ); }  @Override TransactionCommitProcess create( TransactionAppender appender, StorageEngine storageEngine,
            Config config );  }### Answer:
@Test public void createReadOnlyCommitProcess() { CommunityCommitProcessFactory factory = new CommunityCommitProcessFactory(); Config config = Config.defaults( GraphDatabaseSettings.read_only, "true" ); TransactionCommitProcess commitProcess = factory.create( mock( TransactionAppender.class ), mock( StorageEngine.class ), config ); assertThat( commitProcess, instanceOf( ReadOnlyTransactionCommitProcess.class ) ); }
@Test public void createRegularCommitProcess() { CommunityCommitProcessFactory factory = new CommunityCommitProcessFactory(); TransactionCommitProcess commitProcess = factory.create( mock( TransactionAppender.class ), mock( StorageEngine.class ), Config.defaults() ); assertThat( commitProcess, instanceOf( TransactionRepresentationCommitProcess.class ) ); }