How can I find and debug issues stemming from I/O interrupts in Java? What are some best practices to avoid introducing issues in the first place?