@Test
public void testEmptyAttributes() throws Exception {

    // delete names of existing employees so we have some empty attributes
    Query q = new Query();
    QueryClass qcEmployee = new QueryClass(Employee.class);
    q.addFrom(qcEmployee);
    q.addToSelect(qcEmployee);
    ObjectStore os = ObjectStoreFactory.getObjectStore("os.unittest");
    ObjectStoreWriter osw = os.getNewWriter();
    SingletonResults res = os.executeSingleton(q);
    osw.beginTransaction();
    for (Object o : res){
        Employee employee = (Employee) o;
        employee.setName(null);
        osw.store(employee);
    }
    osw.commitTransaction();
    osw.close();
    ObjectStoreSummary oss = new ObjectStoreSummary(os, new Properties());
    Map<String, Set<String>> expectedEmptyAttributes = new HashMap<String, Set<String>>();
    HashSet<String> nameSet = new HashSet<String>(Arrays.asList(new String[] {"name"}));
    expectedEmptyAttributes.put(Employee.class.getName(), nameSet);
    expectedEmptyAttributes.put(Manager.class.getName(), nameSet);
    expectedEmptyAttributes.put(CEO.class.getName(), nameSet);
    // Types.clobObjType also empty for some reason
    expectedEmptyAttributes.put(Types.class.getName(), new HashSet<String>(Arrays.asList(new String[] {"clobObjType"})));
    Assert.assertEquals(expectedEmptyAttributes, oss.emptyAttributesMap);
    // the contents should be the same after a round-trip to the properties file
    Properties ossProps = oss.toProperties();
    ObjectStoreSummary ossFromProps = new ObjectStoreSummary(ossProps);
    Assert.assertEquals(expectedEmptyAttributes, ossFromProps.emptyAttributesMap);
}