@Test
public void signTest() {

	ECKeyPair keyPair = mock(ECKeyPair.class);
	ECDSASignature ecSignature = mock(ECDSASignature.class);
	EUID euid = mock(EUID.class);
	when(keyPair.sign(any(Hash.class))).thenReturn(ecSignature);
	when(keyPair.euid()).thenReturn(euid);
	Atom signedAtom = mock(Atom.class);
	when(signedAtom.getSignature(any())).thenReturn(Optional.of(ecSignature));
	Hash hash = mock(Hash.class);
	Atom atom = mock(Atom.class);
	when(atom.addSignature(any(), any())).thenReturn(signedAtom);
	when(atom.getHash()).thenReturn(hash);
	LocalRadixIdentity identity = new LocalRadixIdentity(keyPair);
	TestObserver<Atom> testObserver = TestObserver.create();
	identity.addSignature(atom).subscribe(testObserver);
	verify(keyPair, never()).getPrivateKey();
	testObserver.assertValue(a -> a.getSignature(euid).get().equals(ecSignature));
}