getTopicMetadata method
Returns TopicMetadata for specified topicName.
If no topic is found will throw StateError.
Implementation
TopicMetadata getTopicMetadata(String topicName) {
return topics.firstWhere((topic) => topic.topicName == topicName, orElse: () => throw new StateError('No topic ${topicName} found in metadata.'));
}