class EC2RaiderImpl implements EC2Raider {

    @Override
    public List<EC2InstanceTO> getInstancesFromAnyTags(List<Tag> tags) {
        List<EC2InstanceTO> instances = new ArrayList<>();
        for (Tag tag : tags) {
            String key = tag.getKey();
            String value = tag.getValue();
            for (Reservation res : ec2Delegator.getEc2().describeInstances().getReservations()) {
                for (Instance i : res.getInstances()) {
                    if (i.getState().getName().equalsIgnoreCase("running")) {
                        for (Tag instanceTag : i.getTags()) {
                            if (key.equalsIgnoreCase(instanceTag.getKey()) && value.equalsIgnoreCase(instanceTag.getValue())) {
                                instances.add(createEc2Instance(i));
                                break;
                            }
                        }
                    }
                }
            }
        }
        return instances;
    }

    public  EC2RaiderImpl();

}