Writing Contract Tests in Java differently

I use contract tests almost everywhere I want an interface, but as Andreas points out, I'm not sure about this specific way to write them outside the context of a library intended for use rather than a library intended for customisation.