This is the only way Hahnemann would have approved of taking coffee. Think what coffee does to you when you drink it too late at night: you can't sleep because your mind seems to be racing; there is great clarity of mind and abundance of thoughts going through your mind. No wonder it is such a seductive brew! But every action has an equal and opposite reaction. Therefore, increasing amounts of coffee are necessary, leading to true addiction (as evidenced by the symptoms of caffeine withdrawal, mentioned under Chamomilla).
So Coffea is indicated in sleeplessness created by overjoyous events or pleasant suprises (winning the lottery, falling in love with someone new, upcoming marriage, etc.) Who said that joy and happy feelings could not be hazardous to your health?
Other indications are toothache (also Hypericum) relieved by cold water, and headaches with a feeling "as if a nail has been pounded in the side of your head." Coffea can be used for coffee headache withdrawals but Chamomilla is a better remedy for this.