@Test
public void testToJSONObject() {

	AssetCategoryMetric childAssetCategoryMetric = new AssetCategoryMetric(
		RandomTestUtil.randomString(), RandomTestUtil.randomString(),
		RandomTestUtil.randomLong());
	AssetVocabularyMetric assetVocabularyMetric = new AssetVocabularyMetric(
		RandomTestUtil.randomString(), RandomTestUtil.randomString(),
		Collections.singletonList(childAssetCategoryMetric));
	AssetCategoryMetric assetCategoryMetric = new AssetCategoryMetric(
		assetVocabularyMetric, RandomTestUtil.randomString(),
		RandomTestUtil.randomString(), RandomTestUtil.randomLong());
	String vocabularyName = RandomTestUtil.randomString();
	Assert.assertEquals(
		JSONUtil.put(
			"categories",
			JSONUtil.put(
				JSONUtil.put(
					"key", childAssetCategoryMetric.getKey()
				).put(
					"name", childAssetCategoryMetric.getName()
				).put(
					"value", childAssetCategoryMetric.getValue()
				).put(
					"vocabularyName", assetVocabularyMetric.getName()
				))
		).put(
			"key", assetCategoryMetric.getKey()
		).put(
			"name", assetCategoryMetric.getName()
		).put(
			"value", assetCategoryMetric.getValue()
		).put(
			"vocabularyName", vocabularyName
		).toString(),
		String.valueOf(assetCategoryMetric.toJSONObject(vocabularyName)));
}