@Test
public void testParseDenseInstance() {

	String testInstanceLine = generateDenseInstanceString(TEST_ATTRIBUTES, TEST_INSTANCE);
	Object parsedInstance = ArffDatasetAdapter.parseInstance(false, TEST_ATTRIBUTES, CLASS_INDEX, testInstanceLine);
	assertTrue("The returned instance is not in the expected dense instance format", parsedInstance instanceof List<?>);
	Object[] parsedDenseInstance = (Object[]) ((List<?>) parsedInstance).get(0);
	Object label = ((List<?>) parsedInstance).get(1);
	assertEquals("The size of the array is varying.", TEST_INSTANCE.length, parsedDenseInstance.length + 1);
	for (int i = 0; i < TEST_INSTANCE.length; i++) {
		if (i == CLASS_INDEX) {
			assertEquals("Attribute value at position " + i + " " + label + " is not equal to the expected value " + TEST_INSTANCE[i], TEST_INSTANCE[i], label);
		} else {
			assertEquals("Attribute value at position " + i + " " + parsedDenseInstance[i] + " is not equal to the expected value " + TEST_INSTANCE[i], TEST_INSTANCE[i], parsedDenseInstance[i]);
		}
	}
	assertTrue("Numeric attribute is not a Number object but of type " + parsedDenseInstance[0].getClass().getName(), parsedDenseInstance[0] instanceof Number);
	assertNotNull("No instance label for dense instance " + parsedInstance, ((List<?>) parsedInstance).get(1));
}