@Test
public void testBuildFromCache() {

	DataTypeBean dtb = new DataTypeBean();
	DataTypeCollection inputBean = null;
	inputBean = new DataTypeCollection("test-type", dtb);
	inputBean.getDataTypeCollection().get(0).setDescription("TEST DESCRIPTION");
	inputBean.getDataTypeCollection().get(0).setName("TEST NAME");
	inputBean.getDataTypeCollection().get(0).setShape(new int[]{1,2,3,4});
	inputBean.getDataTypeCollection().get(0).setRank(1024);
	inputBean.getDataTypeCollection().get(0).setShortname("SHORT NAME");
	inputBean.getDataTypeCollection().get(0).setUnitsstring("UNITS STRING");
	ResponseCache.CacheIdentifier cacheId = null;
	try {
		cacheId = new ResponseCache.CacheIdentifier("https://not-a-r-eal-url.gov", ResponseCache.CacheIdentifier.CacheType.DATA_TYPE, "Dummy cache data");
		boolean didWrite = inputBean.writeToCache(cacheId);
		assertTrue(didWrite);
		DataTypeCollection resultBean = DataTypeCollection.buildFromCache(cacheId);
		assertNotNull(resultBean);
		
		assertEquals(resultBean.getDataType(), "test-type");
		assertEquals(resultBean.getDataTypeCollection().get(0).getDescription(), "TEST DESCRIPTION");
		assertEquals(resultBean.getDataTypeCollection().get(0).getName(), "TEST NAME");
		assertEquals(resultBean.getDataTypeCollection().get(0).getShortname(), "SHORT NAME");
		assertEquals(resultBean.getDataTypeCollection().get(0).getUnitsstring(), "UNITS STRING");
		assertEquals(resultBean.getDataTypeCollection().get(0).getShape()[0], 1);
		assertEquals(resultBean.getDataTypeCollection().get(0).getShape()[1], 2);
		assertEquals(resultBean.getDataTypeCollection().get(0).getShape()[2], 3);
		assertEquals(resultBean.getDataTypeCollection().get(0).getShape()[3], 4);
		assertEquals(resultBean.getDataTypeCollection().get(0).getRank(), 1024);
	} finally {
		if (cacheId != null) {
			try {
				FileUtils.deleteQuietly(cacheId.getFile());
			} catch (IOException ex) {
				// Not handled
			}
		}
	}
}