code: public static String getPackage(Proto proto) {
          DynamicMessage.Value javaPackage = proto.getOptions().get(OPTION_JAVA_PACKAGE);
          if (javaPackage != null) {
              return javaPackage.getString();
          }
          return proto.getPackage().getValue();
      }
docs: Returns java package name.