--- old/test/java/awt/regtesthelpers/Util.java 2014-12-25 17:32:55.000000000 +0300 +++ new/test/java/awt/regtesthelpers/Util.java 2014-12-25 17:32:54.000000000 +0300 @@ -76,12 +76,17 @@ public final class Util { private Util() {} // this is a helper class with static methods :) + private volatile static Robot robot; + /* * @throws RuntimeException when creation failed */ public static Robot createRobot() { try { - return new Robot(); + if (robot == null) { + robot = new Robot(); + } + return robot; } catch (AWTException e) { throw new RuntimeException("Error: unable to create robot", e); } @@ -200,7 +205,10 @@ return false; } - public static void waitForIdle(final Robot robot) { + public static void waitForIdle(Robot robot) { + if (robot == null) { + robot = createRobot(); + } robot.waitForIdle(); }