Luckily StringBuilder and StringBuffer have the same functions so this should be the only line that needs to be changed.