test_class.declarator: ACCOUNT_ID = "GBLUDU6Y6KVM5MCJWOLPVVSJEVICGEGXHOOHEAPWRSXJ7XVMBFKISOLR"
test_class.modifier: private static final
test_class.original_string: private static final String ACCOUNT_ID = "GBLUDU6Y6KVM5MCJWOLPVVSJEVICGEGXHOOHEAPWRSXJ7XVMBFKISOLR";
test_class.type: String
test_class.var_name: ACCOUNT_ID
test_class.declarator: expectedEx = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedEx = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedEx
test_class.declarator: server
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Server server;
test_class.type: Server
test_class.var_name: server
test_class.declarator: mockTransactionsRequestBuilder
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TransactionsRequestBuilder mockTransactionsRequestBuilder;
test_class.type: TransactionsRequestBuilder
test_class.var_name: mockTransactionsRequestBuilder
test_class.declarator: mockServerSentEvent
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ServerSentEvent mockServerSentEvent;
test_class.type: ServerSentEvent
test_class.var_name: mockServerSentEvent
test_class.declarator: blockchainEvents
test_class.modifier: private
test_class.original_string: private BlockchainEvents blockchainEvents;
test_class.type: BlockchainEvents
test_class.var_name: blockchainEvents
test_class.declarator: responsesQueue = new ConcurrentLinkedQueue<>()
test_class.modifier: private
test_class.original_string: private ConcurrentLinkedQueue<TransactionResponse> responsesQueue = new ConcurrentLinkedQueue<>();
test_class.type: ConcurrentLinkedQueue<TransactionResponse>
test_class.var_name: responsesQueue
test_class.declarator: isCancelled = false
test_class.modifier: private volatile
test_class.original_string: private volatile boolean isCancelled = false;
test_class.type: boolean
test_class.var_name: isCancelled
test_class.file: kin-sdk/kin-sdk-lib/src/test/java/kin/sdk/BlockchainEventsTest.java
test_class.identifier: BlockchainEventsTest
test_case.body: @Test
      public void addAccountCreationListener_MultipleTransactions_SingleEvent() throws Exception {
          enqueueCreateAccountResponses();
          enqueueTransactionsResponses();
  
          final int[] eventsCount = {0};
          blockchainEvents.addAccountCreationListener(new EventListener<Void>() {
              @Override
              public void onEvent(Void data) {
                  eventsCount[0]++;
              }
          });
          Thread.sleep(500);
          assertThat(eventsCount[0], equalTo(1));
      }
test_case.class_method_signature: BlockchainEventsTest.addAccountCreationListener_MultipleTransactions_SingleEvent()
test_case.full_signature: @Test public void addAccountCreationListener_MultipleTransactions_SingleEvent()
test_case.identifier: addAccountCreationListener_MultipleTransactions_SingleEvent
test_case.invocations: enqueueCreateAccountResponses enqueueTransactionsResponses addAccountCreationListener sleep assertThat equalTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void addAccountCreationListener_MultipleTransactions_SingleEvent()
focal_class.declarator: ASSET_TYPE_NATIVE = "native"
focal_class.modifier: private static final
focal_class.original_string: private static final String ASSET_TYPE_NATIVE = "native";
focal_class.type: String
focal_class.var_name: ASSET_TYPE_NATIVE
focal_class.declarator: CURSOR_FUTURE_ONLY = "now"
focal_class.modifier: private static final
focal_class.original_string: private static final String CURSOR_FUTURE_ONLY = "now";
focal_class.type: String
focal_class.var_name: CURSOR_FUTURE_ONLY
focal_class.declarator: accountKeyPair
focal_class.modifier: private final
focal_class.original_string: private final KeyPair accountKeyPair;
focal_class.type: KeyPair
focal_class.var_name: accountKeyPair
focal_class.declarator: transactionsStream
focal_class.modifier: private final
focal_class.original_string: private final ManagedServerSentEventStream<TransactionResponse> transactionsStream;
focal_class.type: ManagedServerSentEventStream<TransactionResponse>
focal_class.var_name: transactionsStream
focal_class.file: kin-sdk/kin-sdk-lib/src/main/java/kin/sdk/BlockchainEvents.java
focal_class.identifier: BlockchainEvents
focal_class.class_method_signature: BlockchainEvents.BlockchainEvents(Server server, String accountId)
focal_class.full_signature:   BlockchainEvents(Server server, String accountId)
focal_class.identifier: BlockchainEvents
focal_class.parameters: (Server server, String accountId)
focal_class.signature:  BlockchainEvents(Server server, String accountId)
focal_class.class_method_signature: BlockchainEvents.addBalanceListener(@NonNull final EventListener<Balance> listener)
focal_class.full_signature:  ListenerRegistration addBalanceListener(@NonNull final EventListener<Balance> listener)
focal_class.identifier: addBalanceListener
focal_class.parameters: (@NonNull final EventListener<Balance> listener)
focal_class.return: ListenerRegistration
focal_class.signature: ListenerRegistration addBalanceListener(@NonNull final EventListener<Balance> listener)
focal_class.class_method_signature: BlockchainEvents.extractBalanceChangeFromTransaction(TransactionResponse transactionResponse,
                                                       @NonNull EventListener<Balance> listener)
focal_class.full_signature: private void extractBalanceChangeFromTransaction(TransactionResponse transactionResponse,
                                                       @NonNull EventListener<Balance> listener)
focal_class.identifier: extractBalanceChangeFromTransaction
focal_class.modifiers: private
focal_class.parameters: (TransactionResponse transactionResponse,
                                                       @NonNull EventListener<Balance> listener)
focal_class.return: void
focal_class.signature: void extractBalanceChangeFromTransaction(TransactionResponse transactionResponse,
                                                       @NonNull EventListener<Balance> listener)
focal_class.class_method_signature: BlockchainEvents.extractBalanceFromUpdate(@NonNull EventListener<Balance> listener,
                                            LedgerEntryChange ledgerEntryUpdate)
focal_class.full_signature: private void extractBalanceFromUpdate(@NonNull EventListener<Balance> listener,
                                            LedgerEntryChange ledgerEntryUpdate)
focal_class.identifier: extractBalanceFromUpdate
focal_class.modifiers: private
focal_class.parameters: (@NonNull EventListener<Balance> listener,
                                            LedgerEntryChange ledgerEntryUpdate)
focal_class.return: void
focal_class.signature: void extractBalanceFromUpdate(@NonNull EventListener<Balance> listener,
                                            LedgerEntryChange ledgerEntryUpdate)
focal_class.class_method_signature: BlockchainEvents.addPaymentListener(@NonNull final EventListener<PaymentInfo> listener)
focal_class.full_signature:  ListenerRegistration addPaymentListener(@NonNull final EventListener<PaymentInfo> listener)
focal_class.identifier: addPaymentListener
focal_class.parameters: (@NonNull final EventListener<PaymentInfo> listener)
focal_class.return: ListenerRegistration
focal_class.signature: ListenerRegistration addPaymentListener(@NonNull final EventListener<PaymentInfo> listener)
focal_class.class_method_signature: BlockchainEvents.addAccountCreationListener(final EventListener<Void> listener)
focal_class.full_signature:  ListenerRegistration addAccountCreationListener(final EventListener<Void> listener)
focal_class.identifier: addAccountCreationListener
focal_class.parameters: (final EventListener<Void> listener)
focal_class.return: ListenerRegistration
focal_class.signature: ListenerRegistration addAccountCreationListener(final EventListener<Void> listener)
focal_class.class_method_signature: BlockchainEvents.extractPaymentsFromTransaction(TransactionResponse transactionResponse,
                                                  EventListener<PaymentInfo> listener)
focal_class.full_signature: private void extractPaymentsFromTransaction(TransactionResponse transactionResponse,
                                                  EventListener<PaymentInfo> listener)
focal_class.identifier: extractPaymentsFromTransaction
focal_class.modifiers: private
focal_class.parameters: (TransactionResponse transactionResponse,
                                                  EventListener<PaymentInfo> listener)
focal_class.return: void
focal_class.signature: void extractPaymentsFromTransaction(TransactionResponse transactionResponse,
                                                  EventListener<PaymentInfo> listener)
focal_class.class_method_signature: BlockchainEvents.isPaymentNative(Asset asset)
focal_class.full_signature: private boolean isPaymentNative(Asset asset)
focal_class.identifier: isPaymentNative
focal_class.modifiers: private
focal_class.parameters: (Asset asset)
focal_class.return: boolean
focal_class.signature: boolean isPaymentNative(Asset asset)
focal_class.class_method_signature: BlockchainEvents.extractSourceAccountId(TransactionResponse transactionResponse, Operation operation)
focal_class.full_signature: private String extractSourceAccountId(TransactionResponse transactionResponse, Operation operation)
focal_class.identifier: extractSourceAccountId
focal_class.modifiers: private
focal_class.parameters: (TransactionResponse transactionResponse, Operation operation)
focal_class.return: String
focal_class.signature: String extractSourceAccountId(TransactionResponse transactionResponse, Operation operation)
focal_class.class_method_signature: BlockchainEvents.extractHashTextIfAny(TransactionResponse transactionResponse)
focal_class.full_signature: private String extractHashTextIfAny(TransactionResponse transactionResponse)
focal_class.identifier: extractHashTextIfAny
focal_class.modifiers: private
focal_class.parameters: (TransactionResponse transactionResponse)
focal_class.return: String
focal_class.signature: String extractHashTextIfAny(TransactionResponse transactionResponse)
focal_method.body: ListenerRegistration addAccountCreationListener(final EventListener<Void> listener) {
          checkNotNull(listener, "listener");
  
          final kin.base.requests.EventListener<TransactionResponse> responseListener = new kin.base.requests.EventListener<TransactionResponse>() {
              private boolean eventOccurred = false;
  
              @Override
              public void onEvent(TransactionResponse transactionResponse) {
                  //account creation is one time operation, fire event only once
                  if (!eventOccurred) {
                      eventOccurred = true;
                      listener.onEvent(null);
                  }
              }
          };
  
          transactionsStream.addListener(responseListener);
  
          return new ListenerRegistration(new Runnable() {
              @Override
              public void run() {
                  transactionsStream.removeListener(responseListener);
              }
          });
      }
focal_method.class_method_signature: BlockchainEvents.addAccountCreationListener(final EventListener<Void> listener)
focal_method.full_signature:  ListenerRegistration addAccountCreationListener(final EventListener<Void> listener)
focal_method.identifier: addAccountCreationListener
focal_method.invocations: checkNotNull onEvent addListener removeListener
focal_method.parameters: (final EventListener<Void> listener)
focal_method.return: ListenerRegistration
focal_method.signature: ListenerRegistration addAccountCreationListener(final EventListener<Void> listener)