BitmessageAddress implements Serializable { public void setPubkey(Pubkey pubkey) { if (pubkey instanceof V4Pubkey) { if (!Arrays.equals(tag, ((V4Pubkey) pubkey).getTag())) throw new IllegalArgumentException("Pubkey has incompatible tag"); } if (!Arrays.equals(ripe, pubkey.getRipe())) throw new IllegalArgumentException("Pubkey has incompatible ripe"); this.pubkey = pubkey; } BitmessageAddress(long version, long stream, byte[] ripe);  BitmessageAddress(Pubkey publicKey);  BitmessageAddress(String address, String passphrase);  BitmessageAddress(PrivateKey privateKey);  BitmessageAddress(String address); static BitmessageAddress chan(String address, String passphrase); static BitmessageAddress chan(long stream, String passphrase); static List<BitmessageAddress> deterministic(String passphrase, int numberOfAddresses,
                                                        long version, long stream, boolean shorter); static byte[] calculateTag(long version, long stream, byte[] ripe); long getStream(); long getVersion(); Pubkey getPubkey(); void setPubkey(Pubkey pubkey); byte[] getPublicDecryptionKey(); PrivateKey getPrivateKey(); String getAddress(); String getAlias(); void setAlias(String alias); @Override String toString(); byte[] getRipe(); byte[] getTag(); @Override boolean equals(Object o); @Override int hashCode(); boolean isSubscribed(); void setSubscribed(boolean subscribed); boolean isChan(); void setChan(boolean chan); boolean has(Feature feature);  }
@Test public void ensureV2PubkeyCanBeImported() throws IOException { ObjectMessage object = TestUtils.loadObjectMessage(2, "V2Pubkey.payload"); Pubkey pubkey = (Pubkey) object.getPayload(); BitmessageAddress address = new BitmessageAddress("BM-opWQhvk9xtMFvQA2Kvetedpk8LkbraWHT"); try { address.setPubkey(pubkey); } catch (Exception e) { fail(e.getMessage()); } }