Copy from fluentmock repository