code: public static List<String> splitJson(String combinedJsonString) {
          List<String> result = new ArrayList<>();
  
          int numberOfOpeningBraces = 0;
          boolean isInsideString = false;
          /*
           * A string starts with an unescaped " and ends with an unescaped "} or
           * { within a string must be ignored.
           */
          StringBuilder jsonBuffer = new StringBuilder();
          for (int i = 0; i < combinedJsonString.length(); i++) {
              char c = combinedJsonString.charAt(i);
              if (c == '"' && i > 0 && combinedJsonString.charAt(i - 1) != '\\') {
                  // only switch insideString if " is not escaped
                  isInsideString = !isInsideString;
              }
              if (c == '{' && !isInsideString) {
                  numberOfOpeningBraces++;
              } else if (c == '}' && !isInsideString) {
                  numberOfOpeningBraces--;
              }
  
              jsonBuffer.append(c);
  
              if (numberOfOpeningBraces == 0 && jsonBuffer.length() != 0) {
                  // Prevent empty strings to be added to the result list in case
                  // there are spaces between JSON objects
                  if (jsonBuffer.toString().charAt(0) == '{') {
                      result.add(jsonBuffer.toString());
                  }
                  jsonBuffer.setLength(0);
              }
          }
  
          return result;
      }
docs: This method splits the input string into several json objects. This is
  needed because Atmosphere sends more than one json in a single response.
  <br>
  For example for the input {{test}{test2}}{test3} it would produce the
  following list: [{{test}{test2}}, {test3}]
  @param combinedJsonString The JSON input to be splitted
  @return List of JSON strings