@classmethod
def generate_messages(cls, parts):
    """
        Performs a deterministic first walk of the tree implied by a list of
        message parts.

        generate_messages(["foo", "bar", ["herp", "derp"], "baz"]) yields:
        * "foo"
        * "foo.bar"
        * "foo.bar.herp"
        * "foo.bar.herp.baz"
        * "foo.bar.derp"
        * "foo.bar.derp.baz"
        """
    for message_parts in cls.generate_message_parts(parts):
        yield '.'.join(message_parts)
