public static String removeLastDelimiter(String topic){
  if (topic.endsWith(TOPIC_DELIMITER)) {
    topic=topic.substring(0,topic.length() - TOPIC_DELIMITER.length());
  }
  return topic;
}

public static String removeLastDelimiter ( String topic ) { if ( topic . endsWith ( TOPIC_DELIMITER ) ) { topic = topic . substring ( 0 , topic . length ( ) - TOPIC_DELIMITER . length ( ) ) ; } return topic ; }
removes last topic delimiter if present .
