class LegacyAllocationConverter {

  @NotNull
  public CallStack addCallStack(@NotNull List<StackTraceElement> stackTraceElements) {
    CallStack result;
    if (!myAllocationStacks.containsKey(stackTraceElements)) {
      result = new CallStack(stackTraceElements);
      myAllocationStacks.put(stackTraceElements, result);
    }
    else {
      result = myAllocationStacks.get(stackTraceElements);
    }
    return result;
  }

}