//endregion
//region > Facet Handling
@Override
    public <Q extends Facet> Q getFacet(final Class<Q> facetType) {
        final Q facet = super.getFacet(facetType);
        Q noopFacet = null;
        if (isNotANoopFacet(facet)) {
            return facet;
        } else {
            noopFacet = facet;
        }
        if (interfaces() != null) {
            final List<ObjectSpecification> interfaces = interfaces();
            for (int i = 0; i < interfaces.size(); i++) {
                final ObjectSpecification interfaceSpec = interfaces.get(i);
                if (interfaceSpec == null) {
                    // HACK: shouldn't happen, but occurring on occasion when
                    // running
                    // XATs under JUnit4. Some sort of race condition?
                    continue;
                }
                final Q interfaceFacet = interfaceSpec.getFacet(facetType);
                if (isNotANoopFacet(interfaceFacet)) {
                    return interfaceFacet;
                } else {
                    if (noopFacet == null) {
                        noopFacet = interfaceFacet;
                    }
                }
            }
        }
        // search up the inheritance hierarchy
        final ObjectSpecification superSpec = superclass();
        if (superSpec != null) {
            final Q superClassFacet = superSpec.getFacet(facetType);
            if (isNotANoopFacet(superClassFacet)) {
                return superClassFacet;
            }
        }
        return noopFacet;
    }
@Override
public <Q extends Facet> Q getFacet(final Class<Q> facetType) {
final Q facet = super.getFacet(facetType);
Q noopFacet = null;
if (isNotANoopFacet(facet)) {
return facet;
} else {
noopFacet = facet;
}
if (interfaces() != null) {
final List<ObjectSpecification> interfaces = interfaces();
for (int i = 0; i < interfaces.size(); i++) {
final ObjectSpecification interfaceSpec = interfaces.get(i);
if (interfaceSpec == null) {
// HACK: shouldn't happen, but occurring on occasion when
// running
// XATs under JUnit4. Some sort of race condition?
continue;
}
final Q interfaceFacet = interfaceSpec.getFacet(facetType);
if (isNotANoopFacet(interfaceFacet)) {
return interfaceFacet;
} else {
if (noopFacet == null) {
noopFacet = interfaceFacet;
}
}
}
}
// search up the inheritance hierarchy
final ObjectSpecification superSpec = superclass();
if (superSpec != null) {
final Q superClassFacet = superSpec.getFacet(facetType);
if (isNotANoopFacet(superClassFacet)) {
return superClassFacet;
}
}
return noopFacet;
}
@Override
public <Q extends Facet> Q getFacet(final Class<Q> facetType) {
final Q facet = super.getFacet(facetType);
Q noopFacet = null;
if (isNotANoopFacet(facet)) {
return facet;
} else {
noopFacet = facet;
}
if (interfaces() != null) {
final List<ObjectSpecification> interfaces = interfaces();
for (int i = 0; i < interfaces.size(); i++) {
final ObjectSpecification interfaceSpec = interfaces.get(i);
if (interfaceSpec == null) {
// HACK: shouldn't happen, but occurring on occasion when
// running
// XATs under JUnit4. Some sort of race condition?
continue;
}
final Q interfaceFacet = interfaceSpec.getFacet(facetType);
if (isNotANoopFacet(interfaceFacet)) {
return interfaceFacet;
} else {
if (noopFacet == null) {
noopFacet = interfaceFacet;
}
}
}
}
// search up the inheritance hierarchy
final ObjectSpecification superSpec = superclass();
if (superSpec != null) {
final Q superClassFacet = superSpec.getFacet(facetType);
if (isNotANoopFacet(superClassFacet)) {
return superClassFacet;
}
}
return noopFacet;
}
@Override
public <Q extends Facet> Q getFacet(final Class<Q> facetType) {
final Q facet = super.getFacet(facetType);
Q noopFacet = null;
if (isNotANoopFacet(facet)) {
return facet;
} else {
noopFacet = facet;
}
if (interfaces() != null) {
final List<ObjectSpecification> interfaces = interfaces();
for (int i = 0; i < interfaces.size(); i++) {
final ObjectSpecification interfaceSpec = interfaces.get(i);
if (interfaceSpec == null) {
// HACK: shouldn't happen, but occurring on occasion when
// running
// XATs under JUnit4. Some sort of race condition?
continue;
}
final Q interfaceFacet = interfaceSpec.getFacet(facetType);
if (isNotANoopFacet(interfaceFacet)) {
return interfaceFacet;
} else {
if (noopFacet == null) {
noopFacet = interfaceFacet;
}
}
}
}
// search up the inheritance hierarchy
final ObjectSpecification superSpec = superclass();
if (superSpec != null) {
final Q superClassFacet = superSpec.getFacet(facetType);
if (isNotANoopFacet(superClassFacet)) {
return superClassFacet;
}
}
return noopFacet;
}