@Test
public void testSparse() throws NoSuchFieldException, IllegalAccessException {

    FieldInfo[] infosArray = new FieldInfo[3];
    infosArray[0] = makeFieldInfo(1);
    infosArray[1] = makeFieldInfo(1000);
    infosArray[2] = makeFieldInfo(5000);
    FieldInfos orig = new FieldInfos(infosArray);
    Collection<Object> values = extractValues(orig);
    assertSame(Collections.unmodifiableCollection(new TreeMap<String, Object>().values()).getClass(),
            values.getClass());
    FieldInfoCache cache = new FieldInfoCache();
    FieldInfos fixedFieldInfo = cache.dedupFieldInfos(infosArray);
    values = extractValues(fixedFieldInfo);
    assertSame(Collections.unmodifiableCollection(new TreeMap<String, Object>().values()).getClass(),
            values.getClass());
}