in the case of the tea, the room was a closed system; no energy could enter it. but we can also make it an open system by placing a heater into the room. if we turn on the heater, we can use the heat from it to reheat the cup of tea. new energy has been brought into the room. the entropy has thus decreased. the heat that went from the heater into the tea can then move into the room again until total entropy has been reached. this is what the second law of thermodynamics is about.