@Test public void testGetThreadKey() { assertEquals(expected, generator.getThreadKey(input)); }
public String getThreadKey(String subject) { String wordCharsSubj; String noReSubj; if (subject != null) { noReSubj = removeRe(subject); wordCharsSubj = noReSubj.replaceAll("\\W", "_"); if (!isAddressable(wordCharsSubj)) { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } } else { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } char prefix1; char prefix2; prefix1 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_BIGGEST_ENTROPY); prefix2 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_2ND_BIGGEST_ENTROPY); return ""+prefix1+"/"+prefix1+prefix2+"/"+ makeJcrFriendly(noReSubj); }
ThreadKeyGeneratorImpl implements ThreadKeyGenerator { public String getThreadKey(String subject) { String wordCharsSubj; String noReSubj; if (subject != null) { noReSubj = removeRe(subject); wordCharsSubj = noReSubj.replaceAll("\\W", "_"); if (!isAddressable(wordCharsSubj)) { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } } else { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } char prefix1; char prefix2; prefix1 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_BIGGEST_ENTROPY); prefix2 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_2ND_BIGGEST_ENTROPY); return ""+prefix1+"/"+prefix1+prefix2+"/"+ makeJcrFriendly(noReSubj); } }
ThreadKeyGeneratorImpl implements ThreadKeyGenerator { public String getThreadKey(String subject) { String wordCharsSubj; String noReSubj; if (subject != null) { noReSubj = removeRe(subject); wordCharsSubj = noReSubj.replaceAll("\\W", "_"); if (!isAddressable(wordCharsSubj)) { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } } else { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } char prefix1; char prefix2; prefix1 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_BIGGEST_ENTROPY); prefix2 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_2ND_BIGGEST_ENTROPY); return ""+prefix1+"/"+prefix1+prefix2+"/"+ makeJcrFriendly(noReSubj); }  }
ThreadKeyGeneratorImpl implements ThreadKeyGenerator { public String getThreadKey(String subject) { String wordCharsSubj; String noReSubj; if (subject != null) { noReSubj = removeRe(subject); wordCharsSubj = noReSubj.replaceAll("\\W", "_"); if (!isAddressable(wordCharsSubj)) { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } } else { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } char prefix1; char prefix2; prefix1 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_BIGGEST_ENTROPY); prefix2 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_2ND_BIGGEST_ENTROPY); return ""+prefix1+"/"+prefix1+prefix2+"/"+ makeJcrFriendly(noReSubj); }  String getThreadKey(String subject); }
ThreadKeyGeneratorImpl implements ThreadKeyGenerator { public String getThreadKey(String subject) { String wordCharsSubj; String noReSubj; if (subject != null) { noReSubj = removeRe(subject); wordCharsSubj = noReSubj.replaceAll("\\W", "_"); if (!isAddressable(wordCharsSubj)) { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } } else { noReSubj = wordCharsSubj = UNADDRESSABLE_SUBJECT; } char prefix1; char prefix2; prefix1 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_BIGGEST_ENTROPY); prefix2 = assignPrefix(wordCharsSubj, LETTER_POS_WITH_2ND_BIGGEST_ENTROPY); return ""+prefix1+"/"+prefix1+prefix2+"/"+ makeJcrFriendly(noReSubj); }  String getThreadKey(String subject);  }