FileUtil extends au.gov.ga.worldwind.common.util.FileUtil { public static String stripSequenceNumber(String name) { if (isBlank(name) || !Character.isDigit(name.charAt(name.length()-1))) { return name; } return stripSequenceNumber(name.substring(0, name.length()-1)); }  static String readFileAsString(File file); static void writeStringToFile(String string, File file); static String paddedInt(int value, int charcount); static String createSequenceFileName(String prefix, int sequenceNumber, int padTo, String suffix); static String stripSequenceNumber(String name);  }
@Test public void testStripSequenceNumberBlank() { assertEquals(" ", FileUtil.stripSequenceNumber(" ")); }
@Test public void testStripSequenceNoSequence() { assertEquals("filename", FileUtil.stripSequenceNumber("filename")); }
@Test public void testStripSequenceShortSequence() { assertEquals("filename", FileUtil.stripSequenceNumber("filename01")); }
@Test public void testStripSequenceLongSequence() { assertEquals("filename", FileUtil.stripSequenceNumber("filename0005471")); }
@Test public void testStripSequenceNonSequenceDigits() { assertEquals("file01nam7e", FileUtil.stripSequenceNumber("file01nam7e0005471")); }
@Test public void testStripSequenceNumberEmpty() { assertEquals("", FileUtil.stripSequenceNumber("")); }