Almost every dev using unit tests on his/her Mac spotted popping java icon on dock during running test. It can be totally annoying, especially when you have Android Studio/IntelliJ IDEA open in full screen. There are two simple ways to handle this.
First: To your .bash_profile file add line:
Add above argument to VM execution command on Android Studio/IntelliJ IDEA like on picture above on Configuration screen.