@Override
    public void encode(Object bean, CodedOutputStream output) throws ConverterException {
        try {
            Collection collection = (Collection) field.get(bean);
            for (Object obj : collection) {
                if (obj != null) {
                    ByteArrayOutputStream bout = new ByteArrayOutputStream();
                    CodedOutputStream innerOutput = CodedOutputStream.newInstance(bout);
                    try {
                        byte[] bytes = (byte[]) itemConverter.encode(obj);
                        innerOutput.writeBytes(1, ByteString.copyFrom(bytes));
                        innerOutput.flush();
                        output.writeBytes(id, ByteString.copyFrom(bout.toByteArray()));
                    } catch (IOException e) {
                        throw new ConverterException("Could not write collection '"
                                + field.getName() + "' to byte array!", e);
                    } finally {
                        try {
                            bout.close();
                        } catch (IOException e) {
                            throw new RuntimeException("Could not close output stream!", e);
                        }
                    }
                }
            }
        } catch (IllegalAccessException | RuntimeException e) {
            throw new ConverterException("Exception during serialization", e);
        }
    }