Adapted to handle exceptions.
countMethodsinClassTest passed.
countAttributesInClassTest created.