void buildDestinations(final List<JmsMock> mocks) throws MockServerException { logger.debug("buildDestinations called"); synchronized (monitor) { mocks.forEach(mock -> { if (JmsMockTypeEnum.QUEUE.equals(mock.getJmsType())) { broker.setDestinations(new ActiveMQDestination[] { new ActiveMQQueue(buildJmsUserPath(mock)) }); } else if (JmsMockTypeEnum.TOPIC.equals(mock.getJmsType())) { broker.setDestinations(new ActiveMQDestination[] { new ActiveMQTopic(buildJmsUserPath(mock)) }); } }); } }