@Test
public void testCleanName() {

  // permutations of dot placements
  final String clean = "clean";
  final String dotted = "not.clean";
  final String multiDot = "more.un.clean";
  final String seqDot = "not..clean";
  final String unTrimmed = " .invalid. "; // not really a valid queue
  String cleaned = cleanName(clean);
  assertEquals("Name was changed and it should not", clean, cleaned);
  cleaned = cleanName(dotted);
  assertFalse("Cleaned name contains dots and it should not",
      cleaned.contains(DOT));
  cleaned = cleanName(multiDot);
  assertFalse("Cleaned name contains dots and it should not",
      cleaned.contains(DOT));
  assertNotEquals("Multi dot failed: wrong replacements found",
      cleaned.indexOf(DOT_REPLACEMENT),
      cleaned.lastIndexOf(DOT_REPLACEMENT));
  cleaned = cleanName(seqDot);
  assertFalse("Cleaned name contains dots and it should not",
      cleaned.contains(DOT));
  assertNotEquals("Sequential dot failed: wrong replacements found",
      cleaned.indexOf(DOT_REPLACEMENT),
      cleaned.lastIndexOf(DOT_REPLACEMENT));
  cleaned = cleanName(unTrimmed);
  assertTrue("Trimming start failed: space not removed or dot not replaced",
      cleaned.startsWith(DOT_REPLACEMENT));
  assertTrue("Trimming end failed: space not removed or dot not replaced",
      cleaned.endsWith(DOT_REPLACEMENT));
}