AergoKeyGenerator implements KeyGenerator<AergoKey> { @Override public AergoKey create() { try { final ECDSAKey ecdsaKey = ecdsaKeyGenerator.create(); return new AergoKey(ecdsaKey); } catch (Exception e) { throw new HerajException(e); } }  @Override AergoKey create(); AergoKey create(final String seed);  }
@Test public void testCreate() throws Exception { final AergoKeyGenerator generator = new AergoKeyGenerator(); final AergoKey key = generator.create(); assertNotNull(key.getPrivateKey()); assertNotNull(key.getPublicKey()); assertNotNull(key.getAddress()); }
@Test public void testCreateWithSeed() throws Exception { final AergoKeyGenerator generator = new AergoKeyGenerator(); final String seed = randomUUID().toString(); AergoKey prev = generator.create(seed); for (int i = 1; i < 100; ++i) { final AergoKey curr = generator.create(seed); assertEquals(curr, prev); prev = curr; } }