The Beam SDKs provide language-specific ways to simplify how you provide your DoFn implementation.
FlatMap can be used to simplify DoFn that maps an element to multiple elements (one to many).
Kata: Implement a function that maps each input sentence into words tokenized by whitespace (" ") using FlatMap.