@VisibleForTesting
  static String convertProtoPropertyNameToJavaPropertyName(String input) {
    boolean capitalizeNextLetter = true;
    Preconditions.checkArgument(!Strings.isNullOrEmpty(input));
    StringBuilder result = new StringBuilder(input.length());
    for (int i = 0; i < input.length(); i++) {
      final char c = input.charAt(i);
      if (Character.isLowerCase(c)) {
        if (capitalizeNextLetter) {
          result.append(Character.toUpperCase(c));
        } else {
          result.append(c);
        }
        capitalizeNextLetter = false;
      } else if (Character.isUpperCase(c)) {
        if (i == 0 && !capitalizeNextLetter) {
          // Force first letter to lower-case unless explicitly told to
          // capitalize it.
          result.append(Character.toLowerCase(c));
        } else {
          // Capital letters after the first are left as-is.
          result.append(c);
        }
        capitalizeNextLetter = false;
      } else if ('0' <= c && c <= '9') {
        result.append(c);
        capitalizeNextLetter = true;
      } else {
        capitalizeNextLetter = true;
      }
    }
    // Add a trailing "_" if the name should be altered.
    if (input.charAt(input.length() - 1) == '#') {
      result.append('_');
    }
    return result.toString();
  }
@Test
  public void testGetterNameCreationForProtoPropertyWithNumber() {
    Assert.assertEquals(
        JAVA_PROPERTY_FOR_PROTO_PROPERTY_WITH_NUMBER,
        ProtoByteBuddyUtils.convertProtoPropertyNameToJavaPropertyName(PROTO_PROPERTY_WITH_NUMBER));
  }