@Test
public void identicalInputs() throws Exception {

    // Add four outputs to a transaction with same value and destination. Select them all.
    Transaction t = new Transaction(PARAMS);
    java.util.List<TransactionOutput> outputs = Arrays.asList(
        new TransactionOutput(PARAMS, t, Coin.valueOf(30302787), myAddress),
        new TransactionOutput(PARAMS, t, Coin.valueOf(30302787), myAddress),
        new TransactionOutput(PARAMS, t, Coin.valueOf(30302787), myAddress),
        new TransactionOutput(PARAMS, t, Coin.valueOf(30302787), myAddress)
    );
    t.getConfidence().setConfidenceType(TransactionConfidence.ConfidenceType.BUILDING);
    DefaultCoinSelector selector = new DefaultCoinSelector();
    CoinSelection selection = selector.select(COIN.multiply(2), outputs);
    assertTrue(selection.gathered.size() == 4);
}