class EC2RaiderImpl implements EC2Raider {

    @Override
    public void attachSecurityGroups(String instanceId, String... securityGroups) {

        if (instanceId.isEmpty() || instanceId == null) {
            throw new InvalidInputDataException("Empty/Null instanceId provided in request");
        } else if (securityGroups.length <= 0 || securityGroups == null) {
            throw new InvalidInputDataException("Empty/Null securityGroups provided in request");
        }

        List<String> existingSecurityGroups = this.getSecurityGroups(instanceId);

        if (existingSecurityGroups != null && !existingSecurityGroups.containsAll(Arrays.asList(securityGroups))) {
            existingSecurityGroups.addAll(Arrays.asList(securityGroups));
            ec2Delegator.getEc2().modifyInstanceAttribute(new ModifyInstanceAttributeRequest().withInstanceId(instanceId).withGroups(existingSecurityGroups));
        }

    }

    public  EC2RaiderImpl();

}