public static String capitalize(String name) {
        if (name.length() > 1 && Character.isUpperCase(name.charAt(1))) {
            return name;
        } else if (name.length() > 1) {
            return Character.toUpperCase(name.charAt(0)) + name.substring(1);
        } else {
            return name.toUpperCase();
        }
    }
BeanUtils provides JavaBean compliant property de/capitalization functionality

@author tiwe
querydsl-core/src/main/java/com/querydsl/core/util/BeanUtils.java