@Test
public void selfCreatedAreNotRisky() {

    Transaction tx = new Transaction(PARAMS);
    tx.addInput(PARAMS.getGenesisBlock().getTransactions().get(0).getOutput(0)).setSequenceNumber(1);
    tx.addOutput(COIN, key1);
    tx.setLockTime(TIMESTAMP + 86400);
    {
        // Is risky ...
        DefaultRiskAnalysis analysis = DefaultRiskAnalysis.FACTORY.create(wallet, tx, NO_DEPS);
        assertEquals(RiskAnalysis.Result.NON_FINAL, analysis.analyze());
    }
    tx.getConfidence().setSource(TransactionConfidence.Source.SELF);
    {
        // Is no longer risky.
        DefaultRiskAnalysis analysis = DefaultRiskAnalysis.FACTORY.create(wallet, tx, NO_DEPS);
        assertEquals(RiskAnalysis.Result.OK, analysis.analyze());
    }
}