TenantState { static String encode(final String secret) { try { final MessageDigest mdEnc = MessageDigest.getInstance("MD5"); mdEnc.update(secret.getBytes(Defaults.CHARSET)); return new BigInteger(1, mdEnc.digest()).toString(16); } catch (Exception ex) { return secret; } } TenantState(final SessionInfo sessionInfo); static TenantState of(final SessionInfo session); static Stream<SessionInfo> getKnownTenants(); static void destroyAll(); InstanceState<T> in(final Class<T> cls);  }
@Test void encode() { final String hashed = TenantState.encode("The quick brown fox jumps over the lazy dog."); assertThat(hashed).isEqualTo("e4d909c290d0fb1ca068ffaddf22cbd0"); }