Select one button from multiple buttons on same page

Hey, I’m new to learning appium. I want to automate a scenario in which the user can select anyone button out of 3 buttons then if user will select for example button 1, button2 or button3 then will click on submit button. can anyone guide me how to do this?

@Innaya  Try this code,

List<WebElement> options = driver.findElements(By.xpath("//button")) ;
Random random = new Random();
int index = random.nextInt(options.size());