scala exercises (P22-P23) with custom matcher