// Path: src/main/java/jstellarapi/core/StellarPrivateKey.java
// public class StellarPrivateKey extends StellarIdentifier {
// 	StellarPublicKey publicKey;
// 	
// 	public StellarPrivateKey(byte[] privateKeyBytes) {
// 		super(privateKeyBytes, 101);
// 		if(privateKeyBytes.length!=32){
// 			throw new RuntimeException("The private key must be of length 32 bytes");
// 		}
// 	}
// 
// 	public StellarPrivateKey(byte[] privateKeyBytes, byte[] publicKeyBytes) {
// 		super(privateKeyBytes, 101);
// 		if(privateKeyBytes.length!=32){
// 			throw new RuntimeException("The private key must be of length 32 bytes");
// 		}
// 		publicKey=new StellarPublicKey(publicKeyBytes);
// 	}
// 
// 	public static byte[] bigIntegerToBytes(BigInteger biToConvert, int nbBytesToReturn){
// 		//toArray will return the minimum number of bytes required to encode the biginteger in two's complement.
// 		//Could be less than the expected number of bytes
// 		byte[] twosComplement = biToConvert.toByteArray();
// 		byte[] bytesToReturn=new byte[nbBytesToReturn];
// 
// 		if((biToConvert.bitLength()+7)/8!=twosComplement.length){
// 			//Two's complement representation has a sign bit set on the most significant byte
// 			byte[] twosComplementWithoutSign = new byte[twosComplement.length-1];
// 			System.arraycopy(twosComplement, 1, twosComplementWithoutSign, 0, twosComplementWithoutSign.length);
// 			twosComplement=twosComplementWithoutSign;
// 		}
// 
// 		int nbBytesOfPaddingRequired=nbBytesToReturn-twosComplement.length;
// 		if(nbBytesOfPaddingRequired<0){
// 			throw new RuntimeException("nbBytesToReturn "+nbBytesToReturn+" is too small");
// 		}
// 		System.arraycopy(twosComplement, 0, bytesToReturn, nbBytesOfPaddingRequired, twosComplement.length);
// 
// 		return bytesToReturn;
// 	}
// 	
// 	public StellarPrivateKey(BigInteger privateKeyForAccount) {
// 		super(bigIntegerToBytes(privateKeyForAccount, 32), 34);
// 	}
// 
// 	public StellarPublicKey getPublicKey(){
// 		if(publicKey!=null){
// 			return publicKey;
// 		}
// 
//         GroupElement A = StellarPublicKey.ed25519.getB().scalarMultiply(payloadBytes);
// 		byte[] encodedAndCompressedPublicKeyBytes=A.toByteArray();
// 		publicKey = new StellarPublicKey(encodedAndCompressedPublicKeyBytes);
// 		return publicKey;
// 	}
// 
// 	public ECPrivateKeyParameters getECPrivateKey(){
// 		//Or return the BigInteger instead?
// 		BigInteger privateBI=new BigInteger(1, this.payloadBytes);
// 		ECPrivateKeyParameters privKey = new ECPrivateKeyParameters(privateBI, StellarDeterministicKeyGenerator.SECP256K1_PARAMS);
// 		return privKey;
// 	}
// }
// 
// Path: src/main/java/jstellarapi/core/StellarSeedAddress.java
// public class StellarSeedAddress extends StellarIdentifier {
// 	private static final long serialVersionUID = 1845189349528742766L;
// 	protected StellarPrivateKey privateKey;
// 
// 	public StellarSeedAddress(byte[] payloadBytes) {
// 		super(payloadBytes, 33);
// 		if(payloadBytes.length!=32){
// 			throw new RuntimeException("The seed bytes should be 32 bytes in length. They can be random bytes, or the first 256bit of the SHA512 hash of the passphrase");
// 		}
// 	}
// 
// 	public StellarSeedAddress(String stringID) {
// 		super(stringID);
// 	}
// 
// 	public StellarPrivateKey getPrivateKey() {
// 		if(privateKey==null){
// 			EdDSAPrivateKeySpec keySpec=new EdDSAPrivateKeySpec(payloadBytes, StellarPublicKey.ed25519);
// 			byte[] publicKeyBytes=keySpec.getA().toByteArray();
// 			byte[] privateBytes=keySpec.geta();
// 			privateKey=new StellarPrivateKey(privateBytes, publicKeyBytes);
// 		}
// 		return privateKey;
// 	}
// 
// 	public StellarAddress getPublicStellarAddress() {
// 		return getPrivateKey().getPublicKey().getAddress();
// 	}
// }


import static org.junit.Assert.assertEquals;
import java.math.BigInteger;
import javax.xml.bind.DatatypeConverter;
import jstellarapi.core.StellarPrivateKey;
import jstellarapi.core.StellarSeedAddress;
import org.junit.Test;
package jstellarapi.core;






public class StellarSeedAddressTest {
	@Test
	public void testBigIntegerToBytes() {
		byte[] b1=StellarPrivateKey.bigIntegerToBytes(BigInteger.valueOf(0b10000000), 1);
		assertEquals(1, b1.length);
		assertEquals(128, 0xFF&b1[0]);
	}

	@Test
	public void testStellarSeedAddressStringFirstReport() {
// Path: src/main/java/jstellarapi/core/StellarPrivateKey.java
// public class StellarPrivateKey extends StellarIdentifier {
// 	StellarPublicKey publicKey;
// 	
// 	public StellarPrivateKey(byte[] privateKeyBytes) {
// 		super(privateKeyBytes, 101);
// 		if(privateKeyBytes.length!=32){
// 			throw new RuntimeException("The private key must be of length 32 bytes");
// 		}
// 	}
// 
// 	public StellarPrivateKey(byte[] privateKeyBytes, byte[] publicKeyBytes) {
// 		super(privateKeyBytes, 101);
// 		if(privateKeyBytes.length!=32){
// 			throw new RuntimeException("The private key must be of length 32 bytes");
// 		}
// 		publicKey=new StellarPublicKey(publicKeyBytes);
// 	}
// 
// 	public static byte[] bigIntegerToBytes(BigInteger biToConvert, int nbBytesToReturn){
// 		//toArray will return the minimum number of bytes required to encode the biginteger in two's complement.
// 		//Could be less than the expected number of bytes
// 		byte[] twosComplement = biToConvert.toByteArray();
// 		byte[] bytesToReturn=new byte[nbBytesToReturn];
// 
// 		if((biToConvert.bitLength()+7)/8!=twosComplement.length){
// 			//Two's complement representation has a sign bit set on the most significant byte
// 			byte[] twosComplementWithoutSign = new byte[twosComplement.length-1];
// 			System.arraycopy(twosComplement, 1, twosComplementWithoutSign, 0, twosComplementWithoutSign.length);
// 			twosComplement=twosComplementWithoutSign;
// 		}
// 
// 		int nbBytesOfPaddingRequired=nbBytesToReturn-twosComplement.length;
// 		if(nbBytesOfPaddingRequired<0){
// 			throw new RuntimeException("nbBytesToReturn "+nbBytesToReturn+" is too small");
// 		}
// 		System.arraycopy(twosComplement, 0, bytesToReturn, nbBytesOfPaddingRequired, twosComplement.length);
// 
// 		return bytesToReturn;
// 	}
// 	
// 	public StellarPrivateKey(BigInteger privateKeyForAccount) {
// 		super(bigIntegerToBytes(privateKeyForAccount, 32), 34);
// 	}
// 
// 	public StellarPublicKey getPublicKey(){
// 		if(publicKey!=null){
// 			return publicKey;
// 		}
// 
//         GroupElement A = StellarPublicKey.ed25519.getB().scalarMultiply(payloadBytes);
// 		byte[] encodedAndCompressedPublicKeyBytes=A.toByteArray();
// 		publicKey = new StellarPublicKey(encodedAndCompressedPublicKeyBytes);
// 		return publicKey;
// 	}
// 
// 	public ECPrivateKeyParameters getECPrivateKey(){
// 		//Or return the BigInteger instead?
// 		BigInteger privateBI=new BigInteger(1, this.payloadBytes);
// 		ECPrivateKeyParameters privKey = new ECPrivateKeyParameters(privateBI, StellarDeterministicKeyGenerator.SECP256K1_PARAMS);
// 		return privKey;
// 	}
// }
// 
// Path: src/main/java/jstellarapi/core/StellarSeedAddress.java
// public class StellarSeedAddress extends StellarIdentifier {
// 	private static final long serialVersionUID = 1845189349528742766L;
// 	protected StellarPrivateKey privateKey;
// 
// 	public StellarSeedAddress(byte[] payloadBytes) {
// 		super(payloadBytes, 33);
// 		if(payloadBytes.length!=32){
// 			throw new RuntimeException("The seed bytes should be 32 bytes in length. They can be random bytes, or the first 256bit of the SHA512 hash of the passphrase");
// 		}
// 	}
// 
// 	public StellarSeedAddress(String stringID) {
// 		super(stringID);
// 	}
// 
// 	public StellarPrivateKey getPrivateKey() {
// 		if(privateKey==null){
// 			EdDSAPrivateKeySpec keySpec=new EdDSAPrivateKeySpec(payloadBytes, StellarPublicKey.ed25519);
// 			byte[] publicKeyBytes=keySpec.getA().toByteArray();
// 			byte[] privateBytes=keySpec.geta();
// 			privateKey=new StellarPrivateKey(privateBytes, publicKeyBytes);
// 		}
// 		return privateKey;
// 	}
// 
// 	public StellarAddress getPublicStellarAddress() {
// 		return getPrivateKey().getPublicKey().getAddress();
// 	}
// }


// Path: src/test/java/jstellarapi/core/StellarSeedAddressTest.java
import static org.junit.Assert.assertEquals;
import java.math.BigInteger;
import javax.xml.bind.DatatypeConverter;
import jstellarapi.core.StellarPrivateKey;
import jstellarapi.core.StellarSeedAddress;
import org.junit.Test;

package jstellarapi.core;






public class StellarSeedAddressTest {
	@Test
	public void testBigIntegerToBytes() {
		byte[] b1=StellarPrivateKey.bigIntegerToBytes(BigInteger.valueOf(0b10000000), 1);
		assertEquals(1, b1.length);
		assertEquals(128, 0xFF&b1[0]);
	}

	@Test
	public void testStellarSeedAddressStringFirstReport() {
        StellarSeedAddress seedFirstReported = new StellarSeedAddress("ss1i94tYmAPsGZNHtHiBxTB2okf8Q");