private static String getNewFileName(GroovyFile file) {
    final PsiDirectory dir = file.getContainingDirectory();
    LOG.assertTrue(dir != null);


    final PsiFile[] files = dir.getFiles();
    Set<String> fileNames = ContainerUtil.map2Set(files, PsiFileSystemItem::getName);
    String prefix = FileUtilRt.getNameWithoutExtension(file.getName());
    return UniqueNameGenerator.generateUniqueName(prefix, "", ".java", fileNames);
  }
private static String getNewFileName(GroovyFile file)