def mkPropEqMatcher[T,V](name:String, extr: T => V)(expVal : V): HavePropertyMatcher[T,V] =
new HavePropertyMatcher[T, V] {
def apply(t: T): HavePropertyMatchResult[V] =
HavePropertyMatchResult(
extr(t) == expVal,
name,
expVal,
extr(t)
)
}
val title = mkPropEqMatcher("title", (_ : Book).title) _
val author = mkPropEqMatcher("author", (_ : Book).author) _