public static LayerRefinedResourceSchema getRefinedSchema(
     PrismObject<ResourceType> resource, LayerType layer, PrismContext prismContext)
     throws SchemaException {
   RefinedResourceSchema refinedSchema = getRefinedSchema(resource, prismContext);
   if (refinedSchema == null) {
     return null;
   }
   return refinedSchema.forLayer(layer);
 }
  public static List<String> getIntentsForKind(RefinedResourceSchema rSchema, ShadowKindType kind) {
    List<String> intents = new ArrayList<>();
    for (ObjectClassComplexTypeDefinition objClassDef : rSchema.getObjectClassDefinitions()) {
      if (objClassDef.getKind() == kind) {
        intents.add(objClassDef.getIntent());
      }
    }

    return intents;
  }