class EncodableProcessor extends AbstractProcessor {

  @VisibleForTesting
  static String packageNameToCamelCase(String packageName) {
    if (packageName.isEmpty()) {
      return packageName;
    }
    packageName = Character.toUpperCase(packageName.charAt(0)) + packageName.substring(1);

    int dotIndex = packageName.indexOf('.');
    while (dotIndex > -1) {
      String prefix = packageName.substring(0, dotIndex);
      String suffix = "";
      if (dotIndex < packageName.length() - 1) {
        suffix =
            Character.toUpperCase(packageName.charAt(dotIndex + 1))
                + (dotIndex < packageName.length() - 2 ? packageName.substring(dotIndex + 2) : "");
      }
      packageName = prefix + suffix;
      dotIndex = packageName.indexOf('.');
    }
    return packageName;
  }

}