public static @NotNull PsiElement createFromTemplate(final @NotNull FileTemplate template,
                                                       final @Nullable String fileName,
                                                       @Nullable Properties props,
                                                       final @NotNull PsiDirectory directory) throws Exception {
    Map<String, Object> map;
    if (props != null) {
      map = new HashMap<>();
      putAll(map, props);
    }
    else {
      map = null;
    }
    return createFromTemplate(template, fileName, map, directory, null);
  }
public static @NotNull PsiElement createFromTemplate(final @NotNull FileTemplate template,
                                                       final @Nullable String fileName,
                                                       @Nullable Properties props,
                                                       final @NotNull PsiDirectory directory)