@Test
public void testMultipleLongNames() {

    String filenameFragment = Strings.repeat("a", 512);
    File tempDir = Files.createTempDir();
    ClassFileNameHandler handler = new ClassFileNameHandler(tempDir, ".smali");
    // put the differentiating character in the middle, where it will get stripped out by the filename shortening
    // logic
    File file1 = handler.getUniqueFilenameForClass("La/a/" + filenameFragment  + "1" + filenameFragment + ";");
    checkFilename(tempDir, file1, "a", "a", Strings.repeat("a", 124) + "#" + Strings.repeat("a", 118) + ".smali");
    File file2 = handler.getUniqueFilenameForClass("La/a/" + filenameFragment + "2" + filenameFragment + ";");
    checkFilename(tempDir, file2, "a", "a", Strings.repeat("a", 124) + "#" + Strings.repeat("a", 118) + ".1.smali");
    Assert.assertFalse(file1.getAbsolutePath().equals(file2.getAbsolutePath()));
}