@Test public void create_withMissingDeposit() { final Deposit deposit1 = dataStructureUtil.randomDepositEvent(1); final Deposit deposit3 = dataStructureUtil.randomDepositEvent(3); final Stream<Deposit> depositStream = Stream.of(deposit3, deposit1); assertThatThrownBy( () -> DepositsFromBlockEvent.create( UInt64.ONE, dataStructureUtil.randomBytes32(), UInt64.ONE, depositStream)) .isInstanceOf(InvalidDepositEventsException.class) .hasMessageContaining( "Deposits must be ordered and contiguous. Deposit at index 3 does not follow prior deposit at index 1"); }
public static DepositsFromBlockEvent create( final UInt64 blockNumber, final Bytes32 blockHash, final UInt64 blockTimestamp, final Stream<Deposit> deposits) { final List<Deposit> sortedDeposits = deposits.sorted(Comparator.comparing(Deposit::getMerkle_tree_index)).collect(toList()); return new DepositsFromBlockEvent(blockNumber, blockHash, blockTimestamp, sortedDeposits); }
DepositsFromBlockEvent { public static DepositsFromBlockEvent create( final UInt64 blockNumber, final Bytes32 blockHash, final UInt64 blockTimestamp, final Stream<Deposit> deposits) { final List<Deposit> sortedDeposits = deposits.sorted(Comparator.comparing(Deposit::getMerkle_tree_index)).collect(toList()); return new DepositsFromBlockEvent(blockNumber, blockHash, blockTimestamp, sortedDeposits); } }
DepositsFromBlockEvent { public static DepositsFromBlockEvent create( final UInt64 blockNumber, final Bytes32 blockHash, final UInt64 blockTimestamp, final Stream<Deposit> deposits) { final List<Deposit> sortedDeposits = deposits.sorted(Comparator.comparing(Deposit::getMerkle_tree_index)).collect(toList()); return new DepositsFromBlockEvent(blockNumber, blockHash, blockTimestamp, sortedDeposits); } protected  DepositsFromBlockEvent(
      final UInt64 blockNumber,
      final Bytes32 blockHash,
      final UInt64 blockTimestamp,
      final List<Deposit> deposits); }
DepositsFromBlockEvent { public static DepositsFromBlockEvent create( final UInt64 blockNumber, final Bytes32 blockHash, final UInt64 blockTimestamp, final Stream<Deposit> deposits) { final List<Deposit> sortedDeposits = deposits.sorted(Comparator.comparing(Deposit::getMerkle_tree_index)).collect(toList()); return new DepositsFromBlockEvent(blockNumber, blockHash, blockTimestamp, sortedDeposits); } protected  DepositsFromBlockEvent(
      final UInt64 blockNumber,
      final Bytes32 blockHash,
      final UInt64 blockTimestamp,
      final List<Deposit> deposits); static DepositsFromBlockEvent create(
      final UInt64 blockNumber,
      final Bytes32 blockHash,
      final UInt64 blockTimestamp,
      final Stream<Deposit> deposits); UInt64 getFirstDepositIndex(); UInt64 getLastDepositIndex(); UInt64 getBlockNumber(); Bytes32 getBlockHash(); UInt64 getBlockTimestamp(); List<Deposit> getDeposits(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
DepositsFromBlockEvent { public static DepositsFromBlockEvent create( final UInt64 blockNumber, final Bytes32 blockHash, final UInt64 blockTimestamp, final Stream<Deposit> deposits) { final List<Deposit> sortedDeposits = deposits.sorted(Comparator.comparing(Deposit::getMerkle_tree_index)).collect(toList()); return new DepositsFromBlockEvent(blockNumber, blockHash, blockTimestamp, sortedDeposits); } protected  DepositsFromBlockEvent(
      final UInt64 blockNumber,
      final Bytes32 blockHash,
      final UInt64 blockTimestamp,
      final List<Deposit> deposits); static DepositsFromBlockEvent create(
      final UInt64 blockNumber,
      final Bytes32 blockHash,
      final UInt64 blockTimestamp,
      final Stream<Deposit> deposits); UInt64 getFirstDepositIndex(); UInt64 getLastDepositIndex(); UInt64 getBlockNumber(); Bytes32 getBlockHash(); UInt64 getBlockTimestamp(); List<Deposit> getDeposits(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }