Simple use of the Telegram Bot Java Library
For create your Telegram Bot is necesary send message "/start" to @BotFather Then you will see all bots commands, send "/newbot" and follow instructions of the @BotFather, give your bot unique name then receive a token.
Put it all to the code of your bot class and run your main method. Then your bot will work and will answer to meassages.
The method "onUpdateReceived" will be called when Update is received by your bot.