syntax = "proto2";

package test;

message Foo {
    optional group Foo = 1 {
        option Bar = baz;
        optional Foo foo = 1;
    }

    optional group Bar = 2 {
        optional Foo foo = 1;
    }

    repeated group X = 3 [bar = 1] {
        optional Foo foo = 1;
    }

    required group lowercase = 4 {}

    oneof O {
        group Baz = 5 {}
    }
}