### Question:
InMemoryTokenRepository implements TokenRepository { @Override public void save(TokenInformation tokenInformation) throws TokenPersistenceException { if(tokenInformation == null || !tokenInformation.isValid()) { throw new TokenPersistenceException("Token information which should be store is not valid."); } this.tokenInformation = tokenInformation; }  @Override boolean isEmpty(); @Override void save(TokenInformation tokenInformation); @Override TokenInformation get(); @Override void clear();  }### Answer:
@Test(expected = TokenPersistenceException.class) public void testSave_whenTokensAreInvalid_shouldThrowException() throws Throwable { repository.save(new TokenInformation()); }