Buggy code:
public final class Ec2Launcher { private static final Logger logger = Logger . getLogger ( Ec2Launcher . class ) ; public static boolean TESTING = true ; public final Ec2Context context ; public final SshKeyPair sshKeyPair ; public Ec2Launcher ( Ec2Context context , SshKeyPair sshKeyPair ) { } public static Ec2Context validateCredentials ( Ec2Credentials credentials ) throws InvalidEc2CredentialsException { } public static Ec2Credentials readCredentials ( Confs confs ) { } public void createSecurityGroup ( String clusterName , String groupName , String region , Set < String > ports ) throws KaramelException { Ec2Launcher . logger . info ( String . format ( "Creating<seq2seq4repair_space>security<seq2seq4repair_space>group<seq2seq4repair_space>'%s'<seq2seq4repair_space>..." , groupName ) ) ; if ( ( context ) == null ) { throw new KaramelException ( "Register<seq2seq4repair_space>your<seq2seq4repair_space>valid<seq2seq4repair_space>credentials<seq2seq4repair_space>first<seq2seq4repair_space>:-|<seq2seq4repair_space>" ) ; } if ( ( sshKeyPair ) == null ) { throw new KaramelException ( "Choose<seq2seq4repair_space>your<seq2seq4repair_space>ssh<seq2seq4repair_space>keypair<seq2seq4repair_space>first<seq2seq4repair_space>:-|<seq2seq4repair_space>" ) ; } Optional < ? extends SecurityGroupApi > securityGroupExt = context . getEc2api ( ) . getSecurityGroupApiForRegion ( region ) ; if ( securityGroupExt . isPresent ( ) ) { SecurityGroupApi client = securityGroupExt . get ( ) ; <START_BUG> client . createSecurityGroupInRegion ( region , groupName , ( ( "A<seq2seq4repair_space>region<seq2seq4repair_space>for<seq2seq4repair_space>cluster<seq2seq4repair_space>'" + clusterName ) + "'" ) ) ; <END_BUG> if ( ! ( Ec2Launcher . TESTING ) ) { for ( String port : ports ) { Integer p = null ; IpProtocol pr = null ; if ( port . contains ( "//" ) ) { String [ ] s = port . split ( "//" ) ; p = Integer . valueOf ( s [ 0 ] ) ; pr = IpProtocol . valueOf ( s [ 1 ] ) ; } else { p = Integer . valueOf ( port ) ; pr = IpProtocol . TCP ; } client . authorizeSecurityGroupIngressInRegion ( region , groupName , pr , p , Integer . valueOf ( port ) , "0.0.0.0//0" ) ; Ec2Launcher . logger . info ( String . format ( "Ports<seq2seq4repair_space>became<seq2seq4repair_space>open<seq2seq4repair_space>for<seq2seq4repair_space>'%s'" , groupName ) ) ; } } else { client . authorizeSecurityGroupIngressInRegion ( region , groupName , TCP , 0 , 65535 , "0.0.0.0//0" ) ; Ec2Launcher . logger . info ( String . format ( "Ports<seq2seq4repair_space>became<seq2seq4repair_space>open<seq2seq4repair_space>for<seq2seq4repair_space>'%s'" , groupName ) ) ; } Ec2Launcher . logger . info ( String . format ( "Security<seq2seq4repair_space>group<seq2seq4repair_space>'%s'<seq2seq4repair_space>was<seq2seq4repair_space>created<seq2seq4repair_space>:)" , groupName ) ) ; } } public List < MachineEntity > forkMachines ( String keyPairName , GroupEntity mainGroup , Set < String > securityGroupNames , int size , Ec2 ec2 ) throws KaramelException { } public void cleanup ( String groupName , String region ) throws KaramelException { } }

Fix:
client . createSecurityGroupInRegion ( region , groupName , groupName ) ;