To reduce code duplication this should call mostSimilar() with a null valid ids set. The other mostSimilar will need logic to check if the validIds is null.