class ElastiCacheRaiderImpl implements ElastiCacheRaider {

    @Override
    public void detachSubnet(String clusterName, String subnetId) {

        if (clusterName.isEmpty() || clusterName == null) {
            throw new InvalidInputDataException("Empty/Null clusterName provided in request");
        } else if (subnetId.isEmpty() || subnetId == null) {
            throw new InvalidInputDataException("Empty/Null subnetId provided in request");
        }

        List<String> subnetIds = this.getSubnetIds(clusterName);

        if (subnetIds != null && subnetIds.contains(subnetId)) {
            subnetIds.remove(subnetId);


            ModifyCacheSubnetGroupRequest modifyCacheSubnetGroupRequest = new ModifyCacheSubnetGroupRequest()
                    .withCacheSubnetGroupName(getSubnetGroupName(clusterName))
                    .withSubnetIds(subnetIds);

            elastiCacheDelegator.getAmazonElastiCache().modifyCacheSubnetGroup(modifyCacheSubnetGroupRequest);

        } else {
            throw new com.intuit.cloudraider.exceptions.ResourceNotFoundException("Unable to detach Subnet: " + subnetId);
        }
    }

    public  ElastiCacheRaiderImpl();

}