DLPAggregateId implements AggregateId { @Override public String asAggregateKey() { return PREFIX + SEPARATOR + domain.asString(); } DLPAggregateId(Domain domain); static DLPAggregateId parse(String rawString); @Override String asAggregateKey(); @Override final boolean equals(Object o); @Override final int hashCode();  }
@Test void asAggregateKeyShouldReturnAStringContainingThePrefixAndTheDomain() { assertThat(new DLPAggregateId(Domain.LOCALHOST).asAggregateKey()) .isEqualTo("DLPRule/localhost"); }