private static PsiMethod buildStepDefinitionByStep(@NotNull final GherkinStep step, Language language) {
String annotationPackage = new AnnotationPackageProvider().getAnnotationPackageFor(step);
String methodAnnotation = String.format("@%s.", annotationPackage);
final Step cucumberStep = new Step(new ArrayList<Comment>(), step.getKeyword().getText(), step.getStepName(), 0, null, null);
final String snippet = new SnippetGenerator(new JavaSnippet()).getSnippet(cucumberStep)
.replace("PendingException", CucumberJavaUtil.getCucumberPendingExceptionFqn(step))
.replaceFirst("@", methodAnnotation)
.replaceAll("\\\\\\\\", "\\\\")
.replaceAll("\\\\d", "\\\\\\\\d");