code: @Override
    public byte[] encode(final NamingLookupResponse obj) {
      final List<AvroNamingAssignment> assignments = new ArrayList<>(obj.getNameAssignments().size());
      for (final NameAssignment nameAssignment : obj.getNameAssignments()) {
        assignments.add(AvroNamingAssignment.newBuilder()
            .setId(nameAssignment.getIdentifier().toString())
            .setHost(nameAssignment.getAddress().getHostName())
            .setPort(nameAssignment.getAddress().getPort())
            .build());
      }
      return AvroUtils.toBytes(
          AvroNamingLookupResponse.newBuilder().setTuples(assignments).build(), AvroNamingLookupResponse.class
      );
    }
docs: Encodes name assignments to bytes.
  
  @param obj the naming lookup response
  @return a byte array