added unit tests for A.prototype.compact
Added A.prototype.compact