initial copy from pact4s project (broken)