### Question:
Task extends AbstractStep { public final synchronized Step getSuccessor() { return m_successor; } Task( final String messageKey );  Task( final int workflowId, final Map< String, Serializable > workflowContext, final String messageKey ); final Principal getActor(); final synchronized void setSuccessor( final Step step ); final synchronized Step getSuccessor();  }### Answer:
@Test public void testSuccessors() { final Step d1 = new SimpleDecision( m_workflow.getId(), m_workflow.getAttributes(), "decision1.key", new WikiPrincipal( "Actor1" ) ); m_task.addSuccessor( Outcome.STEP_COMPLETE, d1 ); final Step d2 = new SimpleDecision( m_workflow.getId(), m_workflow.getAttributes(), "decision2.key", new WikiPrincipal( "Actor2" ) ); m_task.addSuccessor( Outcome.STEP_ABORT, d2 ); Assertions.assertEquals( d1, m_task.getSuccessor( Outcome.STEP_COMPLETE ) ); Assertions.assertEquals( d2, m_task.getSuccessor( Outcome.STEP_ABORT ) ); Assertions.assertNull( m_task.getSuccessor( Outcome.DECISION_APPROVE ) ); Assertions.assertNull( m_task.getSuccessor( Outcome.DECISION_DENY ) ); Assertions.assertNull( m_task.getSuccessor( Outcome.DECISION_HOLD ) ); Assertions.assertNull( m_task.getSuccessor( Outcome.DECISION_REASSIGN ) ); Assertions.assertNull( m_task.getSuccessor( Outcome.STEP_CONTINUE ) ); }