How to Make It
Prep the salted cod. Rinse in cold water and place in a bowl; fill the bowl with water and place in the refrigerator. Soak the cod for at least 16 but up to 48 hours, switching out the water twice.
emove the cod and place in a stockpot; cover with water and bring to a boil. Reduce heat to medium-low and simmer for 10 minutes, then drain and set aside to cool, about 20 minutes. At the same time, place the potatoes in a separate pot and cover with water; bring to a boil, reduce heat to medium-low and simmer until just tender, about 10 minutes. Drain and set aside to cool, about 20 minutes.
As the cod and potatoes cook and cool, caramelize the onion. Warm the oil in a skillet over medium-low heat, then add the onion and a pinch of salt. Sauté the onion until caramelized, reducing heat as needed to prevent burning, about 40 minutes, stirring every few minutes.
Once the cod and potatoes have cooled, shred the cod with a fork and slice the potatoes into 1/4-inch slices. Gently toss the potatoes with the melted butter, salt and pepper.
Preheat the oven to 350 degrees. Add half of the potatoes to a casserole or gratin dish, then layer half of the fish, black olives, parsley and caramelized onions on top. Repeat with the remaining ingredients. Bake for 30 minutes and serve with egg and lemon wedges.