@Override
  public void doWork() throws BuildException {
    DescribeTagsRequest request =
        filters != null ? new DescribeTagsRequest(filters) : new DescribeTagsRequest();

    DescribeTagsResult result = getEc2Client().describeTags(request);
    if (result == null || result.getTags() == null || result.getTags().isEmpty()) {
      return;
    }

    for (TagDescription desc : result.getTags()) {
      if (resourceIdArray != null) {
        ArrayManager.add(resourceIdArray, desc.getResourceId());
      }

      if (resourceTypeArray != null) {
        ArrayManager.add(resourceTypeArray, desc.getResourceType());
      }

      if (keysArray != null) {
        ArrayManager.add(keysArray, desc.getKey());
      }

      if (valuesArray != null) {
        ArrayManager.add(valuesArray, desc.getValue());
      }
    }
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof DescribeTagsResult == false) return false;
    DescribeTagsResult other = (DescribeTagsResult) obj;

    if (other.getTags() == null ^ this.getTags() == null) return false;
    if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false;
    if (other.getNextToken() == null ^ this.getNextToken() == null) return false;
    if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
      return false;
    return true;
  }