<dependency>
<groupId>io.github.neodix42</groupId>
<artifactId>mnemonic</artifactId>
<version>0.4.8</version>
</dependency>
<dependency>
<groupId>io.github.neodix42.ton4j</groupId>
<artifactId>mnemonic</artifactId>
<version>0.4.8</version>
</dependency>
List<String> mnemonic=Mnemonic.generate(24,pwd);
String mnemonicPhrase=String.join(" ",mnemonic);
//result
<<mnemonicPhrase containing 24random words>>
More examples on how to construct Mnemonic can be found in TestMnemonic class.