### Question:
DefaultWidgetService implements WidgetService { @Override @Transactional public void removeWidgetComment(String widgetId, String commentId) { widgetRepository.deleteWidgetComment(widgetId, getWidgetComment(widgetId, commentId)); } @Autowired  DefaultWidgetService(WidgetRepository widgetRepository, UserRepository userRepository, CategoryRepository categoryRepository); @Override SearchResult<Widget> getAll(); @Override SearchResult<Widget> getLimitedList(int offset, int pageSize); @Override SearchResult<Widget> getWidgetsByFreeTextSearch(String searchTerm,
                                                           int offset, int pageSize); @Override Widget getWidget(String id); @Override SearchResult<Widget> getPublishedWidgets(int offset, int pageSize); @Override SearchResult<Widget> getPublishedWidgetsByFreeTextSearch(String searchTerm,
                                                                    int offset, int pageSize); @Override SearchResult<Widget> getWidgetsBySearchCriteria(String searchTerm, String widgetType, String widgetStatus,
                                                           int offset, int pageSize); @Override SearchResult<Widget> getWidgetsByOwner(String ownerId, int offset, int pageSize); @Override Widget getWidgetByUrl(String widgetUrl); @Override boolean isRegisteredUrl(String widgetUrl); @Override @Transactional Widget registerNewWidget(Widget widget); @Override WidgetStatistics getWidgetStatistics(String widgetId, String userId); @Override Map<String, WidgetStatistics> getAllWidgetStatistics(String userId); @Override @Transactional void updateWidget(Widget widget); @Override SearchResult<Widget> getWidgetsByTag(String tagKeyWord, int offset, int pageSize); @Override SearchResult<Widget> getWidgetsByCategory(String categoryId, int offset, int pageSize); @Override WidgetTag getWidgetTag(String id); @Override @Transactional WidgetTag createWidgetTag(String widgetId, WidgetTag widgetTag); @Override WidgetTag getWidgetTagByWidgetIdAndKeyword(String widgetId, String keyword); @Override WidgetComment getWidgetComment(String widgetId, String commentId); @Override @Transactional void createWidgetComment(String widgetId, WidgetComment widgetComment); @Override @Transactional void updateWidgetComment(String widgetId, WidgetComment widgetComment); @Override @Transactional void removeWidgetComment(String widgetId, String commentId); @Override @Transactional int deleteAllWidgetComments(String userId); @Override WidgetRating getWidgetRatingByWidgetIdAndUserId(String widgetId, String userId); @Override @Transactional void updateWidgetRatingScore(String widgetId, WidgetRating widgetRating, Integer score); @Override @Transactional void saveWidgetRating(String widgetId, WidgetRating rating); @Override @Transactional void removeWidgetRating(String widgetId, String userId); @Override @Transactional int removeAllWidgetRatings(String userId);  }### Answer:
@Test public void deleteWidgetComment() { WidgetComment comment = new WidgetCommentImpl("1"); expect(widgetRepository.getCommentById("1","1")).andReturn(comment); widgetRepository.deleteWidgetComment("1", comment); replay(widgetRepository); widgetService.removeWidgetComment("1", "1"); verify(widgetRepository); }