Source:
public void test_addSubjectAlternativeNameLintLbyte_array2 ( ) throws java.lang.Exception { org.apache.harmony.security.x509.GeneralName san0 = new org.apache.harmony.security.x509.GeneralName ( new org.apache.harmony.security.x509.OtherName ( "1.2.3.4.5" , new byte [ ] { 1 , 2 , 0 , 1 } ) ) ; org.apache.harmony.security.x509.GeneralName san1 = new org.apache.harmony.security.x509.GeneralName ( 1 , "rfc@822.Name" ) ; org.apache.harmony.security.x509.GeneralName san2 = new org.apache.harmony.security.x509.GeneralName ( 2 , "dNSName" ) ; org.apache.harmony.security.x509.GeneralNames sans1 = new org.apache.harmony.security.x509.GeneralNames ( ) ; sans1.addName ( san0 ) ; sans1.addName ( san1 ) ; sans1.addName ( san2 ) ; java.security.cert.X509CertSelector selector = new java.security.cert.X509CertSelector ( ) ; selector.addSubjectAlternativeName ( 0 , san0.getEncodedName ( ) ) ; selector.addSubjectAlternativeName ( 1 , san1.getEncodedName ( ) ) ; selector.addSubjectAlternativeName ( 2 , san2.getEncodedName ( ) ) ; org.apache.harmony.security.x509.GeneralNames sans2 = new org.apache.harmony.security.x509.GeneralNames ( ) ; sans2.addName ( san0 ) ; tests.security.cert.X509CertSelectorTest.TestCert cert1 = new tests.security.cert.X509CertSelectorTest.TestCert ( sans1 ) ; tests.security.cert.X509CertSelectorTest.TestCert cert2 = new tests.security.cert.X509CertSelectorTest.TestCert ( sans2 ) ; assertTrue ( selector.match ( cert1 ) ) ; assertFalse ( selector.match ( cert2 ) ) ; selector.setSubjectAlternativeNames ( null ) ; org.apache.harmony.security.x509.GeneralName name = new org.apache.harmony.security.x509.GeneralName ( new org.apache.harmony.security.x501.Name ( "O=Android" ) ) ; try { selector.addSubjectAlternativeName ( 0 , name.getEncodedName ( ) ) ; } catch ( java.io.IOException e ) { } }

Target:
public void test_addSubjectAlternativeNameLintLbyte_array2 ( ) throws java.lang.Exception { sun.security.x509.GeneralName san0 = new sun.security.x509.GeneralName ( new sun.security.x509.OtherName ( new sun.security.util.ObjectIdentifier ( "1.2.3.4.5" ) , new byte [ ] { 1 , 2 , 0 , 1 } ) ) ; sun.security.x509.GeneralName san1 = new sun.security.x509.GeneralName ( new sun.security.x509.RFC822Name ( "rfc@822.Name" ) ) ; sun.security.x509.GeneralName san2 = new sun.security.x509.GeneralName ( new sun.security.x509.DNSName ( "dNSName" ) ) ; sun.security.x509.GeneralNames sans1 = new sun.security.x509.GeneralNames ( ) ; sans1.add ( san0 ) ; sans1.add ( san1 ) ; sans1.add ( san2 ) ; java.security.cert.X509CertSelector selector = new java.security.cert.X509CertSelector ( ) ; sun.security.util.DerOutputStream out0 = new sun.security.util.DerOutputStream ( ) ; san0.getName ( ) . encode ( out0 ) ; selector.addSubjectAlternativeName ( 0 , out0.toByteArray ( ) ) ; sun.security.util.DerOutputStream out1 = new sun.security.util.DerOutputStream ( ) ; san1.getName ( ) . encode ( out1 ) ; selector.addSubjectAlternativeName ( 1 , out1.toByteArray ( ) ) ; sun.security.util.DerOutputStream out2 = new sun.security.util.DerOutputStream ( ) ; san2.getName ( ) . encode ( out2 ) ; selector.addSubjectAlternativeName ( 2 , out2.toByteArray ( ) ) ; sun.security.x509.GeneralNames sans2 = new sun.security.x509.GeneralNames ( ) ; sans2.add ( san0 ) ; tests.security.cert.X509CertSelectorTest.TestCert cert1 = new tests.security.cert.X509CertSelectorTest.TestCert ( sans1 ) ; tests.security.cert.X509CertSelectorTest.TestCert cert2 = new tests.security.cert.X509CertSelectorTest.TestCert ( sans2 ) ; assertTrue ( selector.match ( cert1 ) ) ; assertFalse ( selector.match ( cert2 ) ) ; selector.setSubjectAlternativeNames ( null ) ; sun.security.x509.GeneralName name = new sun.security.x509.GeneralName ( new sun.security.x509.X500Name ( "O=Android" ) ) ; try ( sun.security.util.DerOutputStream outputStream = new sun.security.util.DerOutputStream ( ) ) { name.encode ( outputStream ) ; selector.addSubjectAlternativeName ( 0 , outputStream.toByteArray ( ) ) ; } catch ( java.io.IOException e ) { } }