PKCSPrincipal implements Principal, Serializable { @Override public String getName() { return this.alias; } PKCSPrincipal(final String alias); @Override String getName(); @Override String toString();  }
@Test public void canBeSerialized() throws Exception { String name = "jsmith"; PKCSPrincipal instance = new PKCSPrincipal(name); PKCSPrincipal cloned = (PKCSPrincipal) SerializationUtils.clone(instance); assertThat(cloned.getName()).isEqualTo(name); }