private static boolean isAnotherAppInFocus() {
    return KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow() == null &&
           !ApplicationManager.getApplication().isUnitTestMode();
  }
private static boolean isAnotherAppInFocus()