### Question:
Utils { public static String getBaseFileName(final String fileName, final String suffix) { final int suffixIndex = fileName.lastIndexOf("." + suffix); return (suffixIndex > 0 ? fileName.substring(0, suffixIndex) : fileName); }  static boolean hasOrganizationalUnitChanged(final OrganizationalUnit organizationalUnit,
                                                       final OrganizationalUnit activeOrganizationalUnit); static boolean hasProjectChanged(final WorkspaceProject project,
                                            final WorkspaceProject activeProject); static boolean hasBranchChanged(final String branch,
                                           final String activeBranch); static boolean hasModuleChanged(final Module module,
                                           final Module activeModule); static boolean hasPackageChanged(final Package pkg,
                                            final Package activePackage); static boolean hasRepositoryChanged(final Repository repository,
                                               final Repository activeRepository); static boolean hasRepositoryChanged(final WorkspaceProject workspaceProject,
                                               final WorkspaceProject activeWorkspaceProject); static boolean hasFolderItemChanged(final FolderItem item,
                                               final FolderItem activeItem); static FolderItem makeFileItem(final Path path); static FolderItem makeFolderItem(final Path path); static boolean isInBranch(final Path branchRootPath,
                                     final Module module); static boolean isInModule(final Module module,
                                     final Package pkg); static boolean isInFolderItem(final FolderItem folderItem,
                                         final Path resource); static boolean isInPackage(final Package pkg,
                                      final Path resource); static boolean isLeaf(final Path child,
                                 final Path parent); static boolean isSibling(final Path child,
                                    final Path parent); static String getBaseFileName(final String fileName,
                                         final String suffix);  }### Answer:
@Test public void getBaseFileNameSimpleExtension() { when( clientResourceType.getSuffix() ).thenReturn( "xml" ); String result = Utils.getBaseFileName( "filename.xml", clientResourceType.getSuffix() ); assertEquals( "filename", result ); }
@Test public void getBaseFileNameComplexExtension() { when( clientResourceType.getSuffix() ).thenReturn( "suffix.xml" ); String result = Utils.getBaseFileName( "filename.suffix.xml", clientResourceType.getSuffix() ); assertEquals( "filename", result ); }