private static boolean methodVisibleFromPackage(ExecutableElement method, PackageElement pkg) {
        // We use Visibility.ofElement rather than .effectiveVisibilityOfElement because it doesn't
        // really matter whether the containing class is visible. If you inherit a public method
        // then you have a public method, regardless of whether you inherit it from a public class.
        Visibility visibility = Visibility.ofElement(method);
        switch (visibility) {
            case PRIVATE:
                return false;
            case DEFAULT:
                return getPackage(method).equals(pkg);
            default:
                return true;
        }
    }
Static utility methods pertaining to {@link Element} instances.

@author Gregory Kick
android/annotation_processors/xposed_hook_compiler/src/main/java/github/tornaco/permission/compiler/common/MoreElements.java