private boolean keyChainContainsPrivateKey(Collection<ECKey> keyChain,ECKey keyToAdd){
  if (keyChain == null || keyToAdd == null) {
    return false;
  }
 else {
    for (    ECKey loopKey : keyChain) {
      if (Arrays.equals(keyToAdd.getPrivKeyBytes(),loopKey.getPrivKeyBytes())) {
        return true;
      }
    }
    return false;
  }
}

private boolean keyChainContainsPrivateKey ( Collection < ECKey > keyChain , ECKey keyToAdd ) { if ( keyChain == null || keyToAdd == null ) { return false ; } else { for ( ECKey loopKey : keyChain ) { if ( Arrays . equals ( keyToAdd . getPrivKeyBytes ( ) , loopKey . getPrivKeyBytes ( ) ) ) { return true ; } } return false ; } }
this method is here because there is no equals on eckey .
