### Question:
Topic { static boolean containsValidPattern(String topic) { return LEGAL_CHARS_PATTERN.matcher(topic).matches(); }  static void validate(String topic); static boolean isInternal(String topic); static boolean hasCollisionChars(String topic); static boolean hasCollision(String topicA, String topicB); static final String GROUP_METADATA_TOPIC_NAME; static final String TRANSACTION_STATE_TOPIC_NAME; static final String LEGAL_CHARS; }### Answer:
@Test public void shouldRecognizeInvalidCharactersInTopicNames() { char[] invalidChars = {'/', '\\', ',', '\u0000', ':', '"', '\'', ';', '*', '?', ' ', '\t', '\r', '\n', '='}; for (char c : invalidChars) { String topicName = "Is " + c + "illegal"; assertFalse(Topic.containsValidPattern(topicName)); } }