private String nameFromRef(String ref) {

    if ("#".equals(ref)) {
      return null;
    }

    String nameFromRef;
    if (!contains(ref, "#")) {
      nameFromRef = Jsonschema2Pojo.getNodeName(ref, ruleFactory.getGenerationConfig());
    } else {
      String[] nameParts = split(ref, "/\\#");
      nameFromRef = nameParts[nameParts.length - 1];
    }

    try {
      return URLDecoder.decode(nameFromRef, "utf-8");
    } catch (UnsupportedEncodingException e) {
      throw new GenerationException("Failed to decode ref: " + ref, e);
    }
  }
private String nameFromRef(String ref)