private static boolean isLeaf(@NotNull JTree tree, @NotNull TreePath path) {
    return tree.getModel().isLeaf(path.getLastPathComponent()); // TODO:malenkov: via DefaultTreeUI
  }
private static boolean isLeaf(@NotNull JTree tree, @NotNull TreePath path)