Address extends VersionedChecksummedBytes { public boolean isP2SHAddress() { final NetworkParameters parameters = getParameters(); return parameters != null && this.version == parameters.p2shHeader; } Address(NetworkParameters params, int version, byte[] hash160);  Address(NetworkParameters params, byte[] hash160);  Address(@Nullable NetworkParameters params, String address); static Address fromP2SHHash(NetworkParameters params, byte[] hash160); static Address fromP2SHScript(NetworkParameters params, Script scriptPubKey); byte[] getHash160(); boolean isP2SHAddress(); @Nullable NetworkParameters getParameters(); @Nullable static NetworkParameters getParametersFromAddress(String address); static final int LENGTH; }
@Test public void stringification() throws Exception { Address a = new Address(testParams, Hex.decode("fda79a24e50ff70ff42f7d89585da5bd19d9e5cc")); assertEquals("n4eA2nbYqErp7H6jebchxAN59DmNpksexv", a.toString()); assertFalse(a.isP2SHAddress()); Address b = new Address(mainParams, Hex.decode("4a22c3c4cbb31e4d03b15550636762bda0baf85a")); assertEquals("17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL", b.toString()); assertFalse(b.isP2SHAddress()); }