package nakadi;

import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

class ResourceSupport {

  static String nextEid() {
    return UUID.randomUUID().toString();
  }

  static String nextFlowId() {
    return String.format("njc-%d-%016x", System.currentTimeMillis(),
        ThreadLocalRandom.current().nextLong());
  }

  public static ResourceOptions options(String accept) {
    return new ResourceOptions()
        .header("Accept", accept)
        .header("Accept-Charset", "UTF-8")
        .header("User-Agent", NakadiClient.USER_AGENT)
        .flowId(ResourceSupport.nextFlowId());
  }

  public static ResourceOptions optionsWithJsonContent(ResourceOptions options) {
    return options.header("Content-Type", "application/json; charset=utf8");
  }

}

@@ -106,16 +106,71 @@
 port %7B%0A%0A
+  public static final String CHARSET_UTF_8 = %22UTF-8%22;%0A%0A
   static
@@ -547,23 +547,29 @@
 arset%22, 
-%22UTF-8%22
+CHARSET_UTF_8
 )%0A      

Extracts charset string to constant