class CallStack {

  public void enter(final Resource resource) {
    if (stack.contains(resource)) {
      throw new CyclicDependencyException(resource.toString() + " duplicated in " + this);
    }
    stack.push(resource);
  }

}