void (@NotNull String url) { Location location = myTestLocator.getLocation(url); if (location == null) { return; } DataContext data = dataId -> { if (Location.DATA_KEY.is(dataId)) { return location; } return null; }; myCurrentAction.actionPerformed(AnActionEvent.createFromAnAction(myCurrentAction, null, "", data)); }