### Question:
TermState { public boolean update( long newTerm ) { failIfInvalid( newTerm ); boolean changed = term != newTerm; term = newTerm; return changed; } TermState(); private  TermState( long term ); long currentTerm(); boolean update( long newTerm ); @Override String toString();  }### Answer:
@Test public void rejectLowerTerm() { TermState termState = new TermState(); termState.update( 21 ); try { termState.update( 20 ); fail( "Should have thrown exception" ); } catch ( IllegalArgumentException e ) { } }