TestResult (final @NotNull String url) { HgIdentifyCommand identifyCommand = new HgIdentifyCommand(myProject); identifyCommand.setSource(url); HgCommandResult result = identifyCommand.execute(ModalityState.stateForComponent(getRootPane())); return result != null && result.getExitValue() == 0 ? TestResult.SUCCESS : new TestResult(result.getRawError()); }