public static String asTitle(String name) {
        StringBuilder sb = new StringBuilder();
        for (char c : name.toCharArray()) {
            boolean upper = Character.isUpperCase(c);
            boolean first = sb.isEmpty();
            if (first) {
                sb.append(Character.toUpperCase(c));
            } else if (upper) {
                char prev = sb.charAt(sb.length() - 1);
                if (!Character.isUpperCase(prev)) {
                    // append space if previous is not upper
                    sb.append(' ');
                }
                sb.append(c);
            } else {
                sb.append(Character.toLowerCase(c));
            }
        }
        return sb.toString().trim();
    }
@Test
    public void testAsTitle() {
        assertEquals("Broker URL", asTitle("brokerURL"));
        assertEquals("Expose All Queues", asTitle("exposeAllQueues"));
        assertEquals("Reply To Concurrent Consumers", asTitle("replyToConcurrentConsumers"));
    }