}
private Collection<Integer> getAgentInstancesForSelector(ContextPartitionSelector selector) {
Collection<Integer> agentInstanceIds;
if (selector instanceof ContextPartitionSelectorById) {
ContextPartitionSelectorById byId = (ContextPartitionSelectorById) selector;
Set<Integer> ids = byId.getContextPartitionIds();
if (ids == null || ids.isEmpty()) {
return Collections.emptyList();
}
agentInstanceIds = new ArrayList<Integer>(ids);
}