private static Resource createResource(ResourceId resourceId,
ResourceConfiguration resourceConfiguration, IdealState idealState,
ExternalView externalView, ResourceAssignment resourceAssignment) {
UserConfig userConfig;
ProvisionerConfig provisionerConfig = null;
RebalancerConfig rebalancerConfig = null;
if (resourceConfiguration != null) {
userConfig = resourceConfiguration.getUserConfig();
rebalancerConfig = resourceConfiguration.getRebalancerConfig(RebalancerConfig.class);
provisionerConfig = resourceConfiguration.getProvisionerConfig(ProvisionerConfig.class);
} else {