Impairment testing and gain on bargain purchase