class SpringBootMetadataReader {

	private static final Comparator<DefaultMetadataElement> VERSION_METADATA_ELEMENT_COMPARATOR = new VersionMetadataElementComparator();

	private final JsonNode content;

	/**
	 * Parse the content of the metadata at the specified url.
	 * @param objectMapper the object mapper
	 * @param restTemplate the rest template
	 * @param url the metadata URL
	 * @throws IOException on load error
	 */
	SpringBootMetadataReader(ObjectMapper objectMapper, RestTemplate restTemplate, String url) throws IOException {
		this.content = objectMapper.readTree(restTemplate.getForObject(url, String.class));
	}

	/**
	 * Return the boot versions parsed by this instance.
	 * @return the versions
	 */
	List<DefaultMetadataElement> getBootVersions() {<FILL_FUNCTION_BODY>}

	private DefaultMetadataElement parseVersionMetadata(JsonNode node) {
		String versionId = node.get("version").textValue();
		Version version = VersionParser.DEFAULT.safeParse(versionId);
		if (version == null) {
			return null;
		}
		DefaultMetadataElement versionMetadata = new DefaultMetadataElement();
		versionMetadata.setId(versionId);
		versionMetadata.setName(determineDisplayName(version));
		versionMetadata.setDefault(node.get("current").booleanValue());
		return versionMetadata;
	}

	private String determineDisplayName(Version version) {
		StringBuilder sb = new StringBuilder();
		sb.append(version.getMajor()).append(".").append(version.getMinor()).append(".").append(version.getPatch());
		if (version.getQualifier() != null) {
			sb.append(determineSuffix(version.getQualifier()));
		}
		return sb.toString();
	}

	private String determineSuffix(Qualifier qualifier) {
		String id = qualifier.getId();
		if (id.equals("RELEASE")) {
			return "";
		}
		StringBuilder sb = new StringBuilder(" (");
		if (id.contains("SNAPSHOT")) {
			sb.append("SNAPSHOT");
		}
		else {
			sb.append(id);
			if (qualifier.getVersion() != null) {
				sb.append(qualifier.getVersion());
			}
		}
		sb.append(")");
		return sb.toString();
	}

	private static final class VersionMetadataElementComparator implements Comparator<DefaultMetadataElement> {

		private static final VersionParser versionParser = VersionParser.DEFAULT;

		@Override
		public int compare(DefaultMetadataElement o1, DefaultMetadataElement o2) {
			Version o1Version = versionParser.parse(o1.getId());
			Version o2Version = versionParser.parse(o2.getId());
			return o1Version.compareTo(o2Version);
		}

	}

}

		ArrayNode releases = (ArrayNode) this.content.get("_embedded").get("releases");
		List<DefaultMetadataElement> list = new ArrayList<>();
		for (JsonNode node : releases) {
			DefaultMetadataElement versionMetadata = parseVersionMetadata(node);
			if (versionMetadata != null) {
				list.add(versionMetadata);
			}
		}
		list.sort(VERSION_METADATA_ELEMENT_COMPARATOR.reversed());
		return list;
	
<no_super_class>