(Dis)similarity-based hypothesis testing