question: @ SuppressWarnings ( "unchecked" ) public Promise < Result , Progress > resolve ( Result result ) { List < DoneCallback < Result > > doneCallbacks ; List < AlwaysCallback > alwaysCallbacks ; synchronized ( this ) { validateInPendingState ( ) ; mState = STATE_RESOLVED ; printStateChanged ( "RESOLVED" ) ; mResult = result ; doneCallbacks = mCallbacks . cloneDoneCallbacks ( ) ; alwaysCallbacks = mCallbacks . cloneAlwaysCallbacks ( ) ; clearCallbacks ( ) ; } if ( doneCallbacks . size ( ) > 0 || alwaysCallbacks . size ( ) > 0 ) { triggerAllDones ( doneCallbacks ) ; triggerAllAlways ( alwaysCallbacks ) ; } return this ; }
target:  Resolves the promise, triggers any done/always callbacks