### Question:
MongoDbOAuthTokenInfoRepository implements OAuthTokenInfoRepository { @Override public void delete(OAuthTokenInfo item) { template.remove(get(item.getId())); }  @Override OAuthTokenInfo findOAuthTokenInfo(String userId, String appUrl, String moduleId, String tokenName, String serviceName); @Override Class<? extends OAuthTokenInfo> getType(); @Override OAuthTokenInfo get(String id); @Override OAuthTokenInfo save(OAuthTokenInfo item); @Override void delete(OAuthTokenInfo item); @Override List<OAuthTokenInfo> getAll(); @Override List<OAuthTokenInfo> getLimitedList(int offset, int limit); @Override int getCountAll(); void setTemplate(MongoOperations template); static final Class<OAuthTokenInfoImpl> CLASS; }### Answer:
@Test public void delete(){ OAuthTokenInfo item = new OAuthTokenInfoImpl("appUrl", "serviceName", "tokenName", "accessToken", "sessionHandle", "tokenSecret", "userId", 1111L); item.setId("1234L"); template.remove(item); expectLastCall(); expect(template.findById("1234L", CLASS2, OAUTH_TOKEN_COLLECTION)).andReturn((OAuthTokenInfoImpl)item); replay(template); repo.delete(item); verify(template); }