a common pitfall in testing is to hardwire tests to the specifics of an implementation, where those specifics are incidental and have no bearing on the desired functionality.
Once you really understand the problem, go do something involving the creative side of your brain--sketch out the problem, listen to some music, or just take a walk outside.
...software development as a whole involve a continuous learning process. [...] To avoid wasted work, you must allow time to observe the effects of what you are doing, reflect on the things that you see, and change your behavior accordingly.
If you are trying to be focused and "productive" for more than 30 hours a week, you are probably working too hard. You should consider reducing your workload to become more effective and get more done.