Convert string to mixed case This method converts a string to mixed case, id est mixedCase("hello, world!") -&gt; "HeLlO, wOrLd!". 

// Any input string is lower case already
private static String mixedCase(String input) {

    // getAsCharacterList() simply turns a string into a List of Characters. 
    List&lt;Character&gt; charactersAsList = getAsCharacterList(input);
    StringBuilder result = new StringBuilder();
    int index = 0;

    for (Character character : charactersAsList) {
        if (Character.isLetter(character)) {
            if (index % 2 == 0) {
                result.append(Character.toUpperCase(character));
            } else {
                result.append(character);
            }
            index++;
        } else {
            result.append(character);
        }
    }

    return result.toString();
}


It works, but admittedly it looks terrible and I have difficulties making it more concise. I would have preferred to use streams if I didn't had to reference indices...
Is there a more concise way to write this Java string converter?


Sure. No need for the intermediary charactersAsList variable, nor the getAsCharacterList method.

Since you know in advance the final length of the StringBuilder,
it's good to pass that to the constructor when initializing.

// input is already lowercase
private static String mixedCase(String input) {
    StringBuilder result = new StringBuilder(input.length());
    int index = 0;

    for (char character : input.toCharArray()) {
        if (Character.isLetter(character)) {
            if (index % 2 == 0) {
                result.append(Character.toUpperCase(character));
            } else {
                result.append(character);
            }
            index++;
        } else {
            result.append(character);
        }
    }

    return result.toString();
}


Borrowing from the idea of @BrainFRZ to set the already lowercased input in StringBuilder, and from @ferada's comment to use a boolean to decide to uppercase or not, here's another variation that has some advantages:

private static String mixedCase(String input) {
    StringBuilder result = new StringBuilder(input);
    int index = 0;
    boolean toUpper = true;

    for (char character : input.toCharArray()) {
        if (Character.isLetter(character)) {
            if (toUpper) {
                character = Character.toUpperCase(character);
            }
            toUpper = !toUpper;
        }
        result.setCharAt(index, character);
        index++;
    }

    return result.toString();
}


This takes advantage of the input being already lowercased,
and naturally letting StringBuilder to use that.
With some of the conditions eliminated, this version is slightly more compact.