### Question:
MoreElements { public static PackageElement getPackage(Element element) { while (element.getKind() != PACKAGE) { element = element.getEnclosingElement(); } return (PackageElement) element; } private  MoreElements(); static PackageElement getPackage(Element element); static PackageElement asPackage(Element element); static boolean isType(Element element); static TypeElement asType(Element element); static TypeParameterElement asTypeParameter(Element element); static VariableElement asVariable(Element element); static ExecutableElement asExecutable(Element element); static boolean isAnnotationPresent(Element element,
      Class<? extends Annotation> annotationClass); static Optional<AnnotationMirror> getAnnotationMirror(Element element,
      Class<? extends Annotation> annotationClass); static Predicate<T> hasModifiers(Modifier... modifiers); static Predicate<T> hasModifiers(final Set<Modifier> modifiers); @Deprecated static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods(
      TypeElement type, Elements elementUtils); static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods(
      TypeElement type, Types typeUtils, Elements elementUtils); static boolean overrides(
      ExecutableElement overrider,
      ExecutableElement overridden,
      TypeElement type,
      Types typeUtils); static ImmutableSet<ExecutableElement> getAllMethods(
      TypeElement type, Types typeUtils, Elements elementUtils);  }### Answer:
@Test public void getPackage() { assertThat(MoreElements.getPackage(stringElement)).isEqualTo(javaLangPackageElement); for (Element childElement : stringElement.getEnclosedElements()) { assertThat(MoreElements.getPackage(childElement)).isEqualTo(javaLangPackageElement); } }