void resetFrom(@NotNull CompoundScheme<? extends E> template) {
    myElements.clear();
    myElements.ensureCapacity(template.myElements.size());
    for (E element : template.myElements) {
      //noinspection unchecked
      myElements.add((E)element.copy());
    }
  }
void resetFrom(@NotNull CompoundScheme<? extends E> template)