If you wish to perform the same action using different parameters, you can either make differently named functions:
public Apple findAppleById(long id){
return repo.findById(id);
}
public Apple findAppleByCultivar(String cultivar){
return repo.findByCultivar(cultivar);
}
Or you can overload a function and make it less verbose and coupled to the parameter type
public Apple findApple(long id){
return repo.findById(id);
}
public Apple findApple(String cultivar){
return repo.findById(cultivar);
}
Which is considered better practice? I recall Clean Code detailing how including type in variable names (customerName > customerNameString) is considered to be bad practice, so why shouldn't that idea extend to function naming?