public Pizza getSpecificPizza(int index) { init(); if (index < 0) { index = 0; } if (index > (data.size() - 1)) { index = data.size() - 1; } Pizza obj = data.get(index); Long id = obj.getId(); return pizzaService.findPizza(id); }
public Pizza getRandomPizza() { init(); Pizza obj = data.get(rnd.nextInt(data.size())); Long id = obj.getId(); return pizzaService.findPizza(id); }