@Test
public void testContains() {

    TradingSession session = new TradingSessionImpl(DateTimeConstants.FRIDAY, DateTimeConstants.FRIDAY, new LocalTime(8, 30), new LocalTime(15, 30));
    DateTime test = new DateTime(2010, 9, 10, 8, 30, 0, 0);
    assertTrue(session.contains(test));
    
    test = new DateTime(2010, 9, 10, 15, 30, 0, 0);
    assertTrue(session.contains(test));
    
    test = new DateTime(2010, 9, 10, 8, 29, 0, 0);
    assertFalse(session.contains(test));
    
    test = new DateTime(2010, 9, 10, 15, 31, 0, 0);
    assertFalse(session.contains(test));
    
    test = new DateTime(2010, 9, 11, 8, 30, 0, 0);
    assertFalse(session.contains(test));
    
    //Test corner case where the TradingSession spans two days
    session = new TradingSessionImpl(DateTimeConstants.SUNDAY, DateTimeConstants.TUESDAY, new LocalTime(18, 30), new LocalTime(3, 30));
    test = new DateTime(2010, 9, 13, 3, 29, 59, 999);// 9-13 is a Monday
    assertTrue(session.contains(test));
    
    session = new TradingSessionImpl(DateTimeConstants.SUNDAY, DateTimeConstants.TUESDAY, new LocalTime(18, 30), new LocalTime(3, 30));
    test = new DateTime(2010, 9, 11, 3, 29, 59, 999);// 9-11 is a Saturday
    assertFalse(session.contains(test));
    
    session = new TradingSessionImpl(DateTimeConstants.SUNDAY, DateTimeConstants.TUESDAY, new LocalTime(18, 30), new LocalTime(3, 30));
    test = new DateTime(2010, 9, 13, 3, 30, 01, 999);// 9-13 is a Monday
    assertTrue(session.contains(test));
}