code: public static String camelToUnderscore(String value) {
          String result = value.replace(" ", "_");
          result = result.replaceAll("([a-z])([A-Z])", "$1_$2");
          result = result.replace(".", "_");
          result = result.toLowerCase();
          return result;
      }
docs: Convert a string from camel case to underscores, also replacing periods
  with underscores (so for example a fully
  qualified Java class name gets underscores everywhere).
  
  @param value a camel case String
  @return the same value with camels comverted to underscores