private static GroupType listWrapper ( Repetition repetition , String alias , LogicalTypeAnnotation logicalTypeAnnotation , Type nested ) { if ( ! nested . isRepetition ( Repetition . REPEATED ) ) { throw new IllegalArgumentException ( "Nested type should be repeated: " + nested ) ; } return new GroupType ( repetition , alias , logicalTypeAnnotation , nested ) ; }
to preserve the difference between empty list and null when optional