public T sync() {
        //if data is present there's no need to block
        if (data != null) {
            return data;
        }
        synchronized (this) {
            try {
                // wait();
                block.take();
            } catch (InterruptedException e) {
                if (interruptCause == null) {
                    interruptCause = e;
                }
            }
            if (interruptCause != null) {
                if (interruptCause instanceof DataSiftException) {
                    throw (DataSiftException) interruptCause;
                } else {
                    throw new DataSiftException("Interrupted while waiting for response", interruptCause);
                }
            }
            return data;
        }
    }
public T sync ( ) { if ( data != null ) { return data ; } synchronized ( this ) { try { block . take ( ) ; } catch ( InterruptedException e ) { if ( interruptCause == null ) { interruptCause = e ; } } if ( interruptCause != null ) { if ( interruptCause instanceof DataSiftException ) { throw ( DataSiftException ) interruptCause ; } else { throw new DataSiftException ( "Interrupted while waiting for response" , interruptCause ) ; } } return data ; } }
/*
Forces the client to wait until a response is received before returning

@return a result instance - if an interrupt exception is thrown it is possible that a response isn't available
yet the user must check to ensure null isn't returned