// if this node belongs to the requested domain
if (nodeIds.contains(nodeMetadata.getId())) {
// get the status of the node
Status nodeStatus = nodeMetadata.getStatus();
// count nodes that are in pending state
if (nodeStatus.equals(Status.PENDING)) {
pendingInstanceCount++;
}
}
}