"Smart casting in Kotlin" is biased. In Java there's no need to cast objects to Password nor to Username since getValue method is declared in the base class. In order to improve the example, some methods specific to Password and Username should be added.
Can you "invent" some method for Username as well?