final ObjectAdapter createdAdapter;
if(oid instanceof RootOid) {
final RootOid rootOid = (RootOid) oid;
createdAdapter = createRootAdapterAndInferResolveState(pojo, rootOid);
} else if (oid instanceof CollectionOid){
final CollectionOid collectionOid = (CollectionOid) oid;
createdAdapter = createCollectionAdapterAndInferResolveState(pojo, collectionOid);
} else {
final AggregatedOid aggregatedOid = (AggregatedOid) oid;
createdAdapter = createAggregatedAdapter(pojo, aggregatedOid);
}