Buggy code:
@ Component public class EventManager implements EventManagementService { private Logger log = Logger . getLogger ( getClass ( ) . getCanonicalName ( ) ) ; private final int SITE_REMINDERMINUTES = 1440 ; @ Autowired private EventRepository eventRepository ; @ Autowired private MeetingRepository meetingRepository ; @ Autowired private VoteRepository voteRepository ; @ Autowired UserRepository userRepository ; @ Autowired GroupRepository groupRepository ; @ Autowired GroupBroker groupBroker ; @ Autowired UserManagementService userManagementService ; @ Autowired GenericJmsTemplateProducerService jmsTemplateProducerService ; @ Autowired EventLogManagementService eventLogManagementService ; @ Autowired CacheUtilService cacheUtilService ; @ Autowired MeetingNotificationService meetingNotificationService ; @ Autowired GroupLogRepository groupLogRepository ; private static final double SMS_COST = 0.2 ; @ Override public Event getMostRecentEvent ( Group group ) { <START_BUG> return eventRepository . findTopByAppliesToGroupOrderByEventStartDateTimeDesc ( group ) ; <END_BUG> } @ Override public Map < String , Integer > getMeetingRsvpTotals ( Event meeting ) { } @ Override public List < Meeting > getUpcomingMeetings ( Group group ) { } @ Override public List < Vote > getUpcomingVotes ( Group group ) { } @ Override public List < Event > getUpcomingEvents ( Group group ) { } @ Override public List < User > getListOfUsersThatRSVPYesForEvent ( Event event ) { } @ Override public List < User > getListOfUsersThatRSVPNoForEvent ( Event event ) { } @ Override public Map < User , EventRSVPResponse > getRSVPResponses ( Event event ) { } @ Override public int countUpcomingEvents ( Long userId ) { } @ Override public List < Event > getOutstandingVotesForUser ( User user ) { } @ Override public List < Event > getOutstandingRSVPForUser ( User user ) { } private List < Event > getOutstandingResponseForUser ( User user , EventType eventType ) { } @ Override public List < Event > getUpcomingEventsForGroupAndParentGroups ( Group group ) { } @ Override public List < Event > getUpcomingEventsUserCreated ( User requestingUser ) { } @ Override public List < Event > getUpcomingEvents ( User requestingUser , EventType type ) { } @ Override public List < Event > getPaginatedEventsCreatedByUser ( User sessionUser , int pageNumber , int pageSize ) { } @ Override public int userHasEventsToView ( User user , EventType type ) { } @ Override public boolean userHasEventsToView ( User user , EventType type , boolean upcomingOnly ) { } @ Override public boolean userHasPastEventsToView ( User user , EventType type ) { } @ Override public boolean userHasFutureEventsToView ( User user , EventType type ) { } @ Override public Page < Event > getEventsUserCanView ( User user , EventType type , int pastPresentOrBoth , int pageNumber , int pageSize ) { } @ Override public int getNumberInvitees ( Event event ) { } @ Override public Long getNextOutstandingVote ( User sessionUser ) { } @ Override public RSVPTotalsDTO getVoteResultsDTO ( Event vote ) { } @ Override public boolean sendManualReminder ( Event event , String message ) { } @ Override public String getReminderMessageForConfirmation ( String locale , User user , Event event ) { } @ Override public String getDefaultLocaleReminderMessage ( User user , Event event ) { } @ Override public List < Event > getGroupEventsInPeriod ( Group group , LocalDateTime periodStart , LocalDateTime periodEnd ) { } @ Override public List < Event > getEventsForGroupInTimePeriod ( Group group , EventType eventType , LocalDateTime periodStart , LocalDateTime periodEnd ) { } @ Override public double getCostOfMessagesForEvent ( Event event , double costPerMessage ) { } @ Override public double getCostOfMessagesDefault ( Event event ) { } @ Override public int notifyUnableToProcessEventReply ( User user ) { } }

Fix:
return eventRepository . findTopByAppliesToGroupAndEventStartDateTimeNotNullOrderByEventStartDateTimeDesc ( group ) ;