class ObjectiveTracker implements ObjectiveTrackerService {

    @Override
    public void addTrackedResources(Key intentKey,
                                    Collection<NetworkResource> resources) {
        for (NetworkResource resource : resources) {
            if (resource instanceof Link) {
                intentsByLink.put(linkKey((Link) resource), intentKey);
            } else if (resource instanceof ElementId) {
                intentsByElement.put((ElementId) resource, intentKey);
            }
        }
    }

}