### Question:
MongoDbActivityStreamsRepository implements ActivityStreamsRepository { @Override public void delete(ActivityStreamsEntry item) { if(item != null) deleteById(item.getId()); } @Autowired  MongoDbActivityStreamsRepository(MongoOperations template, HydratingConverterFactory converter); @Override List<ActivityStreamsEntry> getAll(); @Override List<ActivityStreamsEntry> getLimitedList(int offset, int limit); @Override int getCountAll(); @Override List<ActivityStreamsEntry> getByUserId(String id); @Override void deleteById(String id); @Override Class<? extends ActivityStreamsEntry> getType(); @Override ActivityStreamsEntry get(String id); @Override ActivityStreamsEntry save(ActivityStreamsEntry item); @Override void delete(ActivityStreamsEntry item);  }### Answer:
@Test public void delete() { ActivityStreamsEntryImpl entry = new ActivityStreamsEntryImpl(); entry.setId(ID); template.remove(Query.query(Criteria.where("_id").is(ID)), ACTIVITIES); expectLastCall(); replay(template); repository.delete(entry); verify(template); }
@Test public void delete_null() { replay(template); repository.delete(null); verify(template); }