master.start();
MasterOperation operation1 = mock(MasterOperation.class, withSettings().serializable());
MasterOperation operation2 = mock(MasterOperation.class, withSettings().serializable());
SerializableCountDownLatchAnswer answer = new SerializableCountDownLatchAnswer(2);
when(operation1.getExecutionInstruction((List<MasterOperation>) notNull()))
.thenReturn(ExecutionInstruction.EXECUTE);
when(operation2.getExecutionInstruction((List<MasterOperation>) notNull()))
.thenReturn(ExecutionInstruction.EXECUTE);
when(operation1.execute((MasterContext) notNull(), (List<MasterOperation>) notNull())).thenAnswer(answer);
when(operation2.execute((MasterContext) notNull(), (List<MasterOperation>) notNull())).thenAnswer(answer);
_protocol.addMasterOperation(operation1);
_protocol.addMasterOperation(operation2);
answer.getCountDownLatch().await();
master.shutdown();
}