class WorkflowAction {

    protected <T> List<T> getRelatedResourcesInVfModule(String vnfId, String vfModuleId, Class<T> resultClass,
            AAIObjectName name) {
        List<T> vnfcs = new ArrayList<>();
        AAIResourceUri uri =
                AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId));
        AAIResultWrapper vfModuleResultsWrapper = bbInputSetupUtils.getAAIResourceDepthOne(uri);
        Optional<Relationships> relationshipsOp = vfModuleResultsWrapper.getRelationships();
        if (!relationshipsOp.isPresent()) {
            logger.debug("No relationships were found for vfModule in AAI");
        } else {
            Relationships relationships = relationshipsOp.get();
            List<AAIResultWrapper> vnfcResultWrappers = relationships.getByType(name);
            for (AAIResultWrapper vnfcResultWrapper : vnfcResultWrappers) {
                Optional<T> vnfcOp = vnfcResultWrapper.asBean(resultClass);
                vnfcOp.ifPresent(vnfcs::add);
            }
        }
        return vnfcs;
    }

}