code: private boolean isPublicAccessible(Member member) {
  
      if (((AccessibleObject) member).isAccessible()) {
        return true;
      }
      if (!Modifier.isPublic(member.getModifiers())) {
        return false;
      }
      if (Modifier.isPublic(member.getDeclaringClass().getModifiers())) {
        return true;
      }
      return false;
    }
docs: This method determines if the given {@link Member} is {@link AccessibleObject#isAccessible() accessible} or
  {@code public} (declared as public in a public class).
  
  @param member is the {@link Member} to check.
  @return {@code true} if it can be accessed, {@code false} if it needs to be made accessible.