@GetMapping("/escortedTours")
public List<PackageHoliday> escortedToursNested() {
return packageHolidayRepository.findPackageHolidayByTypeOfPackageHolidayContains("escortedTours");
}
As you can see, program is returning a list of elements that has typeOfPackeHoliday == escortedTours.
But that return me all elements with that type while I want to return just one random from collection. How I can create method that will return me one random element from collection that have typeOfPackageHoliday == escortedTours