Object delegate = em.getDelegate();
Assert.assertNotNull(delegate);
ObjectManagerImpl om = (ObjectManagerImpl) delegate;
ForceStoreSchemaHandler forceSH = (ForceStoreSchemaHandler) om.getStoreManager().getSchemaHandler();
// Search for TestEntity
TableImpl table = forceSH.getTable("TestEntity");
Assert.assertNotNull(table.getColumnByForceApiName("lastModifiedDate"));
Assert.assertNull(table.getColumnByForceApiName("unused"));
// Do the same test with TestEntityMethodAnnotations
table = forceSH.getTable("TestEntityMethodAnnotations");
Assert.assertNotNull(table.getColumnByForceApiName("lastModifiedDate"));
Assert.assertNull(table.getColumnByForceApiName("unused"));
// Now test the same thing with @Embedded object EmploymentPeriod
table = forceSH.getTable("EmployeeEntity");
Assert.assertNotNull(table.getColumnByForceApiName("emp_end__c"));
Assert.assertNull(table.getColumnByForceApiName("duration__c"));
}