### Question:
LocalFileUtils { public static String getFileNameUpToExtension(final String fileName) { if (fileName == null || fileName.isEmpty()) { throw new IllegalArgumentException("null fileName"); } final int lastDot = fileName.lastIndexOf('.'); if (lastDot == -1) { return ""; } else { return (fileName.substring(0, lastDot)); } } private  LocalFileUtils(); static void stringToFile(final File file, final String string); static String fileContentsAsString(final File file); static String getFileExtension(final String fileName); static String normalizePath(final String inPath); static String getFileNameUpToExtension(final String fileName); static String getFileNameWithTimeStampInterposed(final String fileName); static int countFilesInDirectory(final File directory); static void createLocalFileIfNotExists(final File localFileToHoldData); static long computeCRC32FileCheckSumViaAbsolutePath(final String absolutePathToLocalFile); static byte[] computeSHA256FileCheckSumViaAbsolutePath(final String absolutePathToLocalFile); static byte[] computeMD5FileCheckSumViaAbsolutePath(final String absolutePathToLocalFile); static byte[] hexStringToByteArray(final String s); static String digestByteArrayToString(final byte[] digestAsByteArray); static File getClasspathResourceAsFile(final String resourcePath); static String getClasspathResourceFileAsString(final String resourcePath); static byte[] getBytesFromFile(final File file); static final Logger log; }### Answer:
@Test public void testGetFileNameUpToExtension() throws Exception { String testName = "blah.hellothere file name"; String testExtension = ".txt"; StringBuilder sb = new StringBuilder(); sb.append(testName); sb.append(testExtension); String actual = LocalFileUtils.getFileNameUpToExtension(sb.toString()); Assert.assertEquals(testName, actual); }