public ModelServiceInstance getModelServiceInstance(String serviceName, String instanceId){
        ModelService service = getModelService(serviceName);
        if(service != null && service.getServiceInstances() != null ){
            for(ModelServiceInstance instance : service.getServiceInstances()){
                if(instance.getInstanceId().equals(instanceId)){
                    return instance;
                }
            }
        }
        return null;
    }
public ModelServiceInstance getModelServiceInstance ( String serviceName , String instanceId ) { ModelService service = getModelService ( serviceName ) ; if ( service != null && service . getServiceInstances ( ) != null ) { for ( ModelServiceInstance instance : service . getServiceInstances ( ) ) { if ( instance . getInstanceId ( ) . equals ( instanceId ) ) { return instance ; } } } return null ; }
Get the ModelServiceInstance by serviceName and instanceId.

@param serviceName
the service name.
@param instanceId
the instanceId.
@return
the ModelServiceInstance.