@Test
public void testGetValidBiggerSequence() {

    List<Transaction> list = new ArrayList<>();
    Transaction transaction = new Transaction();
    transaction.setActualTxCost("0.005648");
    transaction.setBlockNumber("10556");
    transaction.setNodeId("0xfa4a45sfa54s4dfa5s");
    transaction.setNodeName("Node-1");
    transaction.setFrom("0x4ded81199608adb765fb2fe029bbfdf57f538be8");
    transaction.setSequence(1025);
    list.add(transaction);
    Transaction transaction2 = new Transaction();
    transaction.setActualTxCost("0.005648");
    transaction.setBlockNumber("10556");
    transaction.setNodeId("0xfa4a45sfa54s4dfa5s");
    transaction.setNodeName("Node-1");
    transaction.setFrom("0x4ded81199608adb765fb2fe029bbfdf57f538be8");
    transaction.setSequence(1028);
    list.add(transaction2);
    Transaction transaction3 = new Transaction();
    transaction.setActualTxCost("0.005648");
    transaction.setBlockNumber("10556");
    transaction.setNodeId("0xfa4a45sfa54s4dfa5s");
    transaction.setNodeName("Node-1");
    transaction.setSequence(1035);
    transaction.setFrom("0x4ded81199608adb765fb2fe029bbfdf57f538be8");
    list.add(transaction3);
    long sequence = Flowable
            .range(0, list.size())
            .filter(new Predicate<Integer>() {
                @Override
                public boolean test(Integer integer) throws Exception {
                    return list.get(integer).getSequence() != 0;
                }
            })
            .map(new Function<Integer, Long>() {
                @Override
                public Long apply(Integer integer) throws Exception {
                    return list.get(integer).getSequence();
                }
            })
            .firstElement()
            .blockingGet();
    assertNotNull(sequence);
    System.out.println(sequence);
}