Buggy code:
public class UserRespondToDistributedInvitations extends SuperUser { private enum State { FETCH_INVITATIONS , SELECT_INVITATIONS , RESPONDTO_INVITATIONS , NO_INVITATIONS ; } public static final String PROMPT_SELECT_FOREIGN_USERNAME = "Please<seq2seq4repair_space>enter<seq2seq4repair_space>foreign<seq2seq4repair_space>username" ; public static final String PROMPT_SEE_INVITATIONS = "Fetching<seq2seq4repair_space>from<seq2seq4repair_space>server..." ; public static final String PROMPT_SELECT_INVITATION = ( ( '\n' + "Select<seq2seq4repair_space>the<seq2seq4repair_space>id<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>invitation<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>respond<seq2seq4repair_space>to." ) + "\n" ) + "Type<seq2seq4repair_space>'none'<seq2seq4repair_space>if<seq2seq4repair_space>you<seq2seq4repair_space>don't<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>respond<seq2seq4repair_space>at<seq2seq4repair_space>this<seq2seq4repair_space>time" ; public static final String PROMPT_RESPOND_TO_INVITATIONS = '\n' + "Sweet,<seq2seq4repair_space>now<seq2seq4repair_space>please<seq2seq4repair_space>enter<seq2seq4repair_space>your<seq2seq4repair_space>response" ; public static final String HELP_SELECT_FOREIGN_USERNAME = "You<seq2seq4repair_space>should<seq2seq4repair_space>enter<seq2seq4repair_space>the<seq2seq4repair_space>username<seq2seq4repair_space>who's<seq2seq4repair_space>invitations<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>respond<seq2seq4repair_space>to" ; public static final String HELP_SELECT_INVITATION = "Type<seq2seq4repair_space>the<seq2seq4repair_space>eventId<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>event<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>select" ; public static final String HELP_RESPOND_TO_INVITATION = "Type<seq2seq4repair_space>'accept',<seq2seq4repair_space>'decline'<seq2seq4repair_space>or<seq2seq4repair_space>'maybe'<seq2seq4repair_space>to<seq2seq4repair_space>respond<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>selected<seq2seq4repair_space>invitation" ; public static final String DONE_SUCCESS = "Returning<seq2seq4repair_space>to<seq2seq4repair_space>main<seq2seq4repair_space>menu." ; private UserRespondToDistributedInvitations . State state = UserRespondToDistributedInvitations . State . FETCH_INVITATIONS ; private ServerRespondToDistributedInvitations server = new ServerRespondToDistributedInvitations ( ) ; private String selectedUsername ; private int selectedInvitation ; private String invitationReply ; public UserRespondToDistributedInvitations ( ControllerInterface delegator ) { } public void startRunning ( ) { } public void sendNextInput ( String nextInput ) { switch ( this . state ) { case FETCH_INVITATIONS : this . selectedUsername = nextInput ; System . out . println ( "Fetching<seq2seq4repair_space>from<seq2seq4repair_space>server..." ) ; System . out . println ( "\n" ) ; ServerInvitationsResult invitationResult = this . server . checkForInvitations ( User . currentUser ( ) . username , selectedUsername ) ; if ( ( invitationResult . eventids ) == null ) { this . state = UserRespondToDistributedInvitations . State . NO_INVITATIONS ; this . delegator . delegateIsDone ( "No<seq2seq4repair_space>pending<seq2seq4repair_space>invitations<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>username.<seq2seq4repair_space>Exiting<seq2seq4repair_space>to<seq2seq4repair_space>main<seq2seq4repair_space>menu..." ) ; } else { System . out . println ( ( ( "Invitations<seq2seq4repair_space>below:" + '\n' ) + ( invitationResult . toString ( ) ) ) ) ; this . state = UserRespondToDistributedInvitations . State . SELECT_INVITATIONS ; this . delegator . delegateIsReadyForNextInputWithPrompt ( ( ( ( '\n' + "Select<seq2seq4repair_space>the<seq2seq4repair_space>id<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>invitation<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>respond<seq2seq4repair_space>to." ) + "\n" ) + "Type<seq2seq4repair_space>'none'<seq2seq4repair_space>if<seq2seq4repair_space>you<seq2seq4repair_space>don't<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>respond<seq2seq4repair_space>at<seq2seq4repair_space>this<seq2seq4repair_space>time" ) ) ; } break ; case SELECT_INVITATIONS : if ( nextInput . equals ( "none" ) ) { this . state = UserRespondToDistributedInvitations . State . NO_INVITATIONS ; this . delegator . delegateIsDone ( ( '\n' + "Aight,<seq2seq4repair_space>returning<seq2seq4repair_space>to<seq2seq4repair_space>main<seq2seq4repair_space>menu<seq2seq4repair_space>sir!" ) ) ; } try { this . selectedInvitation = Integer . parseInt ( nextInput ) ; } catch ( NumberFormatException n ) { System . out . println ( "Only<seq2seq4repair_space>integers<seq2seq4repair_space>allowed!" ) ; this . state = UserRespondToDistributedInvitations . State . SELECT_INVITATIONS ; this . delegator . delegateIsReadyForNextInputWithPrompt ( "Try<seq2seq4repair_space>again,<seq2seq4repair_space>moron" ) ; } this . state = UserRespondToDistributedInvitations . State . RESPONDTO_INVITATIONS ; this . delegator . delegateIsReadyForNextInputWithPrompt ( ( '\n' + "Sweet,<seq2seq4repair_space>now<seq2seq4repair_space>please<seq2seq4repair_space>enter<seq2seq4repair_space>your<seq2seq4repair_space>response" ) ) ; break ; case RESPONDTO_INVITATIONS : this . invitationReply = nextInput . toLowerCase ( ) ; if ( ( ( this . invitationReply . equals ( "accept" ) ) || ( this . invitationReply . equals ( "decline" ) ) ) || ( this . invitationReply . equals ( "maybe" ) ) ) { <START_BUG> ServerInvitationsResult selection = this . server . respontoInvitation ( selectedInvitation , invitationReply , User . currentUser ( ) . username ) ; <END_BUG> if ( selection . didSucceed = true ) { System . out . println ( "Changes<seq2seq4repair_space>applied<seq2seq4repair_space>successfully." ) ; this . delegator . delegateIsDone ( "Returning<seq2seq4repair_space>to<seq2seq4repair_space>main<seq2seq4repair_space>menu." ) ; } else { System . out . println ( "Changes<seq2seq4repair_space>not<seq2seq4repair_space>applied." ) ; this . delegator . delegateIsDone ( "Returning<seq2seq4repair_space>to<seq2seq4repair_space>main<seq2seq4repair_space>menu." ) ; } } else { System . out . println ( "Hey!<seq2seq4repair_space>Wrong<seq2seq4repair_space>input!<seq2seq4repair_space>Type<seq2seq4repair_space>either<seq2seq4repair_space>'accept',<seq2seq4repair_space>'decline'<seq2seq4repair_space>or<seq2seq4repair_space>'maybe'" ) ; this . state = UserRespondToDistributedInvitations . State . RESPONDTO_INVITATIONS ; this . delegator . delegateIsReadyForNextInputWithPrompt ( "Try<seq2seq4repair_space>again" ) ; } break ; } } public void userAsksForHelp ( ) { } }

Fix:
ServerInvitationsResult selection = this . server . respontoInvitation ( selectedInvitation , invitationReply , selectedUsername ) ;