class FlinkMetricContainer {

	@VisibleForTesting
	static MetricGroup registerMetricGroup(MetricKey metricKey, MetricGroup metricGroup) {
		ArrayList<String> scopeComponents = getNameSpaceArray(metricKey);
		int size = scopeComponents.size();
		List<String> metricGroupNames = scopeComponents.subList(0, size / 2);
		List<String> metricGroupTypes = scopeComponents.subList(size / 2, size);
		for (int i = 0; i < metricGroupNames.size(); ++i) {
			if (metricGroupTypes.get(i).equals("MetricGroupType.generic")) {
				metricGroup = metricGroup.addGroup(metricGroupNames.get(i));
			} else if (metricGroupTypes.get(i).equals("MetricGroupType.key")) {
				metricGroup = metricGroup.addGroup(
					metricGroupNames.get(i),
					metricGroupNames.get(++i));
			}
		}
		return metricGroup;
	}

	public  FlinkMetricContainer(MetricGroup metricGroup);

}