Context ctx = new MockMessageCatalogContext(baos);
Writer writer = factory.getWriter(ctx,
clazz.getCanonicalName());
try {
MessageInterfaceVisitor cv = writer.visitClass();
msgIntf.accept(cv);
} finally {
writer.close();
}
return baos.toByteArray();
}