The retention of a benefit conferred in misreliance upon a right or duty is generally inequitable. Certain circumstances, however, have been recognized by the courts as justifying a refusal to make restitution. Most of the cases fall within one or another of the following groups:
(1) Where the plaintiff has been guilty of serious misconduct toward the defendant.
(2) Where the plaintiff, though mistaken as to his legal right or duty, was under a moral obligation to confer the benefit.
(3) Where the plaintiff received something of value from the defendant in exchange for the benefit conferred, and though able to return the same in specie has failed to do so.
(4) Where, in consequence of the mistake and at the defendant's expense, the plaintiff reaped a benefit equivalent in Value to that conferred upon the defendant.
(5) Where the defendant is free from responsibility for the plaintiff's mistake, or is responsible in no greater degree than the plaintiff, and has so changed his position that the enforcement of restitution would subject him to loss.