@Override
    public Result analyze() {
        checkState(!analyzed);
        analyzed = true;

        Result result = analyzeIsFinal();
        if (result != null && result != Result.OK)
            return result;

        return analyzeIsStandard();
    }
@Test
    public void standardOutputs() {
        Transaction tx = new Transaction();
        tx.addInput(MAINNET.getGenesisBlock().getTransactions().get(0).getOutput(0));
        // A pay to address output
        tx.addOutput(Coin.CENT, ScriptBuilder.createP2PKHOutputScript(key1));
        // A P2PK output
        tx.addOutput(Coin.CENT, ScriptBuilder.createP2PKOutputScript(key1));
        tx.addOutput(Coin.CENT, ScriptBuilder.createP2PKOutputScript(key1));
        // 1-of-2 multisig output.
        List<ECKey> keys = Arrays.asList(key1, new ECKey());
        tx.addOutput(Coin.CENT, ScriptBuilder.createMultiSigOutputScript(1, keys));
        // 2-of-2 multisig output.
        tx.addOutput(Coin.CENT, ScriptBuilder.createMultiSigOutputScript(2, keys));
        // P2SH
        tx.addOutput(Coin.CENT, ScriptBuilder.createP2SHOutputScript(1, keys));
        // OP_RETURN
        tx.addOutput(Coin.CENT, ScriptBuilder.createOpReturnScript("hi there".getBytes()));
        assertEquals(RiskAnalysis.Result.OK, DefaultRiskAnalysis.FACTORY.create(wallet, tx, NO_DEPS).analyze());
    }