TradeReferenceLine { protected Side parseSide( String side ) { if( "Exit".equalsIgnoreCase(side)) { return Side.EXIT; } else if( "Entry".equalsIgnoreCase(side)) { return Side.ENTRY; } else { throw new IllegalStateException( "Unknown Side: " + side ); } }  void parse( String referenceLine ); String getStrategy(); String getCorrelationId(); Direction getDirection(); Side getSide(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static long serialVersionUID; }
@Test public void testParseSide() { assertEquals(testLine.parseSide("Entry"), ENTRY); assertEquals(testLine.parseSide("Exit"), EXIT); try { testLine.parseSide("foo"); } catch( IllegalStateException ex ) { } }