private String setInstanceStatus(String feedName, String instanceId, String status) {
    String currentStatus = null;
    Map<String, Instance> instances = instanceMap.get(feedName);

    if (instances != null) {
      Instance instance = instances.get(instanceId);
      if (instance != null) {
        currentStatus = instance.getStatus();
        if (!currentStatus.equals(status)) {
          instance = new Instance(instance.getFeedName(),
                                  instance.getId(),
                                  status,
                                  instance.getStartTime(),
                                  instance.getEndTime(),
                                  instance.getDetails(),
                                  instance.getLog());
          instances.put(instance.getId(), instance);
        }
      }
    }
    return currentStatus;
  }
An IvoryService implementation used for testing the DR related resource providers.
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/TestIvoryService.java