public void testMax() {
assertEquals( 5, list.max() );
assertEquals( 1, list.min() );
TIntList list2 = new TIntLinkedList();
assertTrue( list2.isEmpty() );
list2.add( 3 );
list2.add( 1 );
list2.add( 2 );
list2.add( 5 );
list2.add( 4 );
assertEquals( 5, list2.max() );
assertEquals( 1, list2.min() );
try {
TIntList list3 = new TIntLinkedList();
list3.min();
fail( "Expected IllegalStateException" );
}
catch ( IllegalStateException ex ) {
// Expected
}
try {
TIntList list3 = new TIntLinkedList();
list3.max();
fail( "Expected IllegalStateException" );
}
catch ( IllegalStateException ex ) {
// Expected
}