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 addPaymentListener() throws Exception {
          enqueueTransactionsResponses();
  
          final CountDownLatch latch = new CountDownLatch(1);
          final List<PaymentInfo> actualResults = new ArrayList<>();
          blockchainEvents.addPaymentListener(new EventListener<PaymentInfo>() {
              @Override
              public void onEvent(PaymentInfo data) {
                  actualResults.add(data);
                  if (actualResults.size() == 2) {
                      latch.countDown();
                  }
              }
          });
          assertTrue(latch.await(1, TimeUnit.SECONDS));
  
          assertThat(actualResults.size(), equalTo(2));
          PaymentInfo payment1 = actualResults.get(0);
          PaymentInfo payment2 = actualResults.get(1);
          assertThat(payment1.hash().id(),
                  equalTo("3eb3024a9c03451e7c8b8d3ba525a3a241e286cb694a262444d46d92e7605f22"));
          assertThat(payment1.sourcePublicKey(), equalTo("GBLUDU6Y6KVM5MCJWOLPVVSJEVICGEGXHOOHEAPWRSXJ7XVMBFKISOLR"));
          assertThat(payment1.destinationPublicKey(),
                  equalTo("GANPYEGVH3ZVQFMQVVYFRP7U3HKE5LIJ3345ORI26G2OAX7HV66VIE7F"));
          assertThat(payment1.amount(), equalTo(new BigDecimal("250")));
          assertThat(payment1.createdAt(), equalTo("2018-11-19T15:59:07Z"));
          assertThat(payment1.fee(), equalTo(100L));
          assertThat(payment1.memo(), equalTo("1-test-test1"));
  
          assertThat(payment2.hash().id(),
                  equalTo("c4ad29472150a741c0924086a76fea1aac326261afacee05c0b36be7e8fb5727"));
          assertThat(payment2.sourcePublicKey(), equalTo("GBLUDU6Y6KVM5MCJWOLPVVSJEVICGEGXHOOHEAPWRSXJ7XVMBFKISOLR"));
          assertThat(payment2.destinationPublicKey(),
                  equalTo("GANPYEGVH3ZVQFMQVVYFRP7U3HKE5LIJ3345ORI26G2OAX7HV66VIE7F"));
          assertThat(payment2.amount(), equalTo(new BigDecimal("250")));
          assertThat(payment2.createdAt(), equalTo("2018-11-19T16:36:42Z"));
          assertThat(payment2.fee(), equalTo(100L));
          assertThat(payment2.memo(), equalTo("1-test-test1"));
      }
test_case.class_method_signature: BlockchainEventsTest.addPaymentListener()
test_case.full_signature: @Test public void addPaymentListener()
test_case.identifier: addPaymentListener
test_case.invocations: enqueueTransactionsResponses addPaymentListener add size countDown assertTrue await assertThat size equalTo get get assertThat id hash equalTo assertThat sourcePublicKey equalTo assertThat destinationPublicKey equalTo assertThat amount equalTo assertThat createdAt equalTo assertThat fee equalTo assertThat memo equalTo assertThat id hash equalTo assertThat sourcePublicKey equalTo assertThat destinationPublicKey equalTo assertThat amount equalTo assertThat createdAt equalTo assertThat fee equalTo assertThat memo equalTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void addPaymentListener()
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 addPaymentListener(@NonNull final EventListener<PaymentInfo> listener) {
          checkNotNull(listener, "listener");
  
          final kin.base.requests.EventListener<TransactionResponse> responseListener = new kin.base.requests.EventListener<TransactionResponse>() {
              @Override
              public void onEvent(TransactionResponse transactionResponse) {
                  extractPaymentsFromTransaction(transactionResponse, listener);
              }
          };
  
          transactionsStream.addListener(responseListener);
  
          return new ListenerRegistration(new Runnable() {
              @Override
              public void run() {
                  transactionsStream.removeListener(responseListener);
              }
          });
      }
focal_method.class_method_signature: BlockchainEvents.addPaymentListener(@NonNull final EventListener<PaymentInfo> listener)
focal_method.full_signature:  ListenerRegistration addPaymentListener(@NonNull final EventListener<PaymentInfo> listener)
focal_method.identifier: addPaymentListener
focal_method.invocations: checkNotNull extractPaymentsFromTransaction addListener removeListener
focal_method.parameters: (@NonNull final EventListener<PaymentInfo> listener)
focal_method.return: ListenerRegistration
focal_method.signature: ListenerRegistration addPaymentListener(@NonNull final EventListener<PaymentInfo> listener)