SubscriptionUtil { static int getSubscriptionHashCode(final DirectBuffer correlationKey) { int hashCode = 0; for (int i = 0, length = correlationKey.capacity(); i < length; i++) { hashCode = 31 * hashCode + correlationKey.getByte(i); } return hashCode; }  static int getSubscriptionPartitionId(
      final DirectBuffer correlationKey, final int partitionCount);  }
@Test public void shouldGetSubscriptionHashCode() { assertThat(getSubscriptionHashCode(wrapString("a"))).isEqualTo(97); assertThat(getSubscriptionHashCode(wrapString("b"))).isEqualTo(98); assertThat(getSubscriptionHashCode(wrapString("c"))).isEqualTo(99); assertThat(getSubscriptionHashCode(wrapString("foobar"))).isEqualTo(-1268878963); }
@Test public void shouldGetZeroSubscriptionHashCodeIfEmpty() { assertThat(getSubscriptionHashCode(new UnsafeBuffer())).isEqualTo(0); }