public synchronized GcmHelper addRegistrationCallback(@NonNull Context context,@NonNull GcmRegistrationListener registrationListener,boolean sticky){
  if (null == registrationCallbacks) {
    registrationCallbacks=new ConcurrentLinkedQueue<>();
  }
  registrationCallbacks.add(registrationListener);
  if (sticky && !TextUtils.isEmpty(this.pushToken)) {
    registrationListener.onTokenAvailable(context,pushToken,false);
  }
  return this;
}

public synchronized GcmHelper addRegistrationCallback ( @ NonNull Context context , @ NonNull GcmRegistrationListener registrationListener , boolean sticky ) { if ( null == registrationCallbacks ) { registrationCallbacks = new ConcurrentLinkedQueue < > ( ) ; } registrationCallbacks . add ( registrationListener ) ; if ( sticky && ! TextUtils . isEmpty ( this . pushToken ) ) { registrationListener . onTokenAvailable ( context , pushToken , false ) ; } return this ; }
add a gcm registration listener . this does not replace the existing listeners but adds to the list of listeners
