Germany, the fourth-largest economy in the world and a leader in renewable energy, produced so much energy this weekend from its solar, wind, hydro, and biomass plants that power prices went into negative territory for several hours. Consumers were being paid to use energy.