### Question:
Outcome implements Serializable { public static Outcome forName( final String key ) throws NoSuchOutcomeException { if( key != null ) { for( final Outcome outcome : OUTCOMES ) { if( outcome.m_key.equals( key ) ) { return outcome; } } } throw new NoSuchOutcomeException( "Outcome " + key + " not found." ); } private  Outcome( final String key, final boolean completion ); boolean isCompletion(); String getMessageKey(); int hashCode(); boolean equals( final Object obj ); static Outcome forName( final String key ); String toString(); static final Outcome STEP_COMPLETE; static final Outcome STEP_ABORT; static final Outcome STEP_CONTINUE; static final Outcome DECISION_ACKNOWLEDGE; static final Outcome DECISION_APPROVE; static final Outcome DECISION_DENY; static final Outcome DECISION_HOLD; static final Outcome DECISION_REASSIGN; }### Answer:
@Test public void testForName() { try { Assertions.assertEquals( Outcome.DECISION_ACKNOWLEDGE, Outcome.forName( "outcome.decision.acknowledge" ) ); Assertions.assertEquals( Outcome.DECISION_APPROVE, Outcome.forName( "outcome.decision.approve" ) ); Assertions.assertEquals( Outcome.DECISION_DENY, Outcome.forName( "outcome.decision.deny" ) ); Assertions.assertEquals( Outcome.DECISION_HOLD, Outcome.forName( "outcome.decision.hold" ) ); Assertions.assertEquals( Outcome.DECISION_REASSIGN, Outcome.forName( "outcome.decision.reassign" ) ); Assertions.assertEquals( Outcome.STEP_ABORT, Outcome.forName( "outcome.step.abort" ) ); Assertions.assertEquals( Outcome.STEP_COMPLETE, Outcome.forName( "outcome.step.complete" ) ); Assertions.assertEquals( Outcome.STEP_CONTINUE, Outcome.forName( "outcome.step.continue" ) ); } catch( final NoSuchOutcomeException e ) { Assertions.fail( "Could not look up an Outcome..." ); } try { Outcome.forName( "outcome.decision.nonexistent" ); } catch( final NoSuchOutcomeException e ) { return; } Assertions.fail( "Could not look up an Outcome..." ); }