code: private static Serializer<?> getSerializer(Kryo kryo, Class<?> type) {
          Registration registration = kryo.getClassResolver().getRegistration(type);
          return registration != null ? registration.getSerializer() : null;
      }
docs: /* kryo.getSerializer (invoking kryo.getRegistration) throws an exception if registration is required,
  therefore we're getting a potentially existing serializer on another way.