Buggy code:
public final class DiscordClientImpl implements IDiscordClient { protected volatile long timer = System . currentTimeMillis ( ) ; protected User ourUser ; protected String token ; protected volatile long heartbeat ; protected final List < IGuild > guildList = new ArrayList < > ( ) ; protected String email ; protected String password ; protected DiscordWS ws ; protected EventDispatcher dispatcher ; protected final List < IPrivateChannel > privateChannels = new ArrayList < > ( ) ; protected boolean isReady = false ; protected String sessionId ; protected long lastSequence = 0 ; protected final List < IRegion > REGIONS = new ArrayList < > ( ) ; public DiscordClientImpl ( String email , String password ) { } @ Override public EventDispatcher getDispatcher ( ) { } @ Override public String getToken ( ) { } @ Override public void login ( ) throws IOException , URISyntaxException { } @ Override public void logout ( ) throws HTTP403Exception { } private String obtainGateway ( String token ) { } @ Override public IMessage sendMessage ( String content , String channelID ) throws IOException { } @ Override public IMessage editMessage ( String content , String messageID , String channelID ) { } @ Override public void deleteMessage ( String messageID , String channelID ) throws IOException { } @ Override public void changeAccountInfo ( String username , String email , String password , Image avatar ) throws UnsupportedEncodingException , URISyntaxException { } @ Override public void updatePresence ( boolean isIdle , Optional < String > game ) { } @ Override public boolean isReady ( ) { } @ Override public IUser getOurUser ( ) { } @ Override public IChannel getChannelByID ( String id ) { } @ Override public IVoiceChannel getVoiceChannelByID ( String id ) { } @ Override public IGuild getGuildByID ( String guildID ) { } @ Override public List < IGuild > getGuilds ( ) { } @ Override public IUser getUserByID ( String userID ) { } @ Override public IPrivateChannel getOrCreatePMChannel ( IUser user ) throws Exception { } @ Override public void toggleTypingStatus ( String channelID ) { } @ Override public boolean getTypingStatus ( String channelID ) { } @ Override public IInvite createInvite ( int maxAge , int maxUses , boolean temporary , boolean useXkcdPass , String channelID ) { } @ Override public IInvite getInviteForCode ( String code ) { } @ Override public IChannel createChannel ( IGuild guild , String name ) throws DiscordException , HTTP403Exception { } @ Override public List < IRegion > getRegions ( ) throws HTTP403Exception { } @ Override public IRegion getRegionForID ( String regionID ) { } @ Override public IGuild createGuild ( String name , Optional < String > regionID , Optional < Image > icon ) throws HTTP403Exception { try { <START_BUG> GuildResponse guildResponse = GSON . fromJson ( POST . makeRequest ( SERVERS , new org . apache . http . entity . StringEntity ( GSON . toJson ( new CreateGuildRequest ( name , regionID . orElse ( null ) , icon . orElse ( null ) ) ) ) , new BasicNameValuePair ( "authorization" , this . token ) , new BasicNameValuePair ( "content-type" , "application//json" ) ) , GuildResponse . class ) ; <END_BUG> return DiscordUtils . getGuildFromJSON ( this , guildResponse ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } return null ; } }

Fix:
GuildResponse guildResponse = GSON . fromJson ( POST . makeRequest ( SERVERS , new org . apache . http . entity . StringEntity ( GSON . toJson ( new CreateGuildRequest ( name , regionID . orElse ( "us-west" ) , icon . orElse ( Image . defaultAvatar ( ) ) ) ) ) , new BasicNameValuePair ( "authorization" , this . token ) , new BasicNameValuePair ( "content-type" , "application//json" ) ) , GuildResponse . class ) ;