@Test public void appendShouldNotAppendExtensionWhenExtensionExists() throws Exception { final String actual = Extensions.append("foo.java", JavaFileType.INSTANCE); assertThat(actual) .isEqualTo("foo.java"); }
@Nonnull @CheckReturnValue public static String append(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName; } return fileName + DELIMITER + extension; }
Extensions { @Nonnull @CheckReturnValue public static String append(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName; } return fileName + DELIMITER + extension; } }
Extensions { @Nonnull @CheckReturnValue public static String append(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName; } return fileName + DELIMITER + extension; } private  Extensions(); }
Extensions { @Nonnull @CheckReturnValue public static String append(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName; } return fileName + DELIMITER + extension; } private  Extensions(); @Nonnull @CheckReturnValue static String remove(@Nonnull String fileName, @Nonnull FileType fileType); @Nonnull @CheckReturnValue static String append(@Nonnull String fileName, @Nonnull FileType fileType); }
Extensions { @Nonnull @CheckReturnValue public static String append(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName; } return fileName + DELIMITER + extension; } private  Extensions(); @Nonnull @CheckReturnValue static String remove(@Nonnull String fileName, @Nonnull FileType fileType); @Nonnull @CheckReturnValue static String append(@Nonnull String fileName, @Nonnull FileType fileType);  }