Preheat the oven to 350°F. Grease a 13x9-inch baking dish. Put the sweet potatoes into a saucepan, cover them with water, and bring them to a boil. Reduce the heat and simmer until the potatoes are fork-tender. Drain, then add the butter and salt and pepper. Mash the potatoes and set aside. Crumble the sausage into a skillet over medium heat and sauté until done. Drain the fat, reserving 2 tablespoons. Transfer the sausage to a bowl. Return the skillet to the heat, add the reserved fat, mushrooms, and onion, and cook until the onion is soft. Add mushrooms and onion to the sausage. In the prepared baking dish, layer half of the mashed sweet potatoes, half of the sausage, and all of the apple slices. Repeat (ending with the sausage). Bake uncovered for 35 minutes. Sprinkle the cheese on top and bake for 8 to 10 minutes.