generator/src/org/immutables/generator/SourceOrdering.java
@SuppressWarnings("unchecked")
  public static ImmutableList<Element> getEnclosedElements(Element element) {
    return (ImmutableList<Element>) enclosedBy(element).immutableSortedCopy(element.getEnclosedElements());
  }
@SuppressWarnings("unchecked")
  public static ImmutableList<Element> getEnclosedElements(Element element) {
    return (ImmutableList<Element>) enclosedBy(element).immutableSortedCopy(element.getEnclosedElements());
  }
it's safe to cast immutable list of <? extends Element> to a list of <Element>