code: public static ProtocolFamily convert(InternetProtocolFamily family) {
          switch (family) {
          case IPv4:
              return StandardProtocolFamily.INET;
          case IPv6:
              return StandardProtocolFamily.INET6;
          default:
              throw new IllegalArgumentException();
          }
      }
docs: Convert the {@link InternetProtocolFamily}. This MUST only be called on jdk version >= 7.