<dependency>
<groupId>io.github.neodix42</groupId>
<artifactId>mnemonic</artifactId>
<version>0.4.7</version>
</dependency>
<dependency>
<groupId>io.github.neodix42.ton4j</groupId>
<artifactId>mnemonic</artifactId>
<version>0.4.7</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.