@Override
@SuppressWarnings("unchecked")
public <E extends Element> E getAncestor(Class<E> elementClass) {
E element = getBaseElement().getAncestor(elementClass);
ParameterizedType definingType = getDefiningType();
if (definingType instanceof InterfaceType) {
InterfaceType definingInterfaceType = (InterfaceType) definingType;
if (element instanceof ConstructorElement) {
return (E) ConstructorMember.from((ConstructorElement) element, definingInterfaceType);
} else if (element instanceof MethodElement) {