Function invariantLaws

Test typeclass laws for Invariant.