### Question:
BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } BuildMonitorInstallation();  BuildMonitorInstallation(StaticJenkinsAPIs jenkinsAPIs); String anonymousCorrelationId(); int size(); Audience audience(); String buildMonitorVersion();  }### Answer:
@Test public void helps_to_avoid_duplicated_stats_and_keep_jenkins_instance_anonymous() throws Exception { BuildMonitorInstallation installation = new BuildMonitorInstallation(withPublicKey(PUBLIC_KEY)); assertThat(installation.anonymousCorrelationId(), is(not(PUBLIC_KEY))); assertThat(installation.anonymousCorrelationId().length(), is(64)); }
@Test public void only_calculates_the_correlation_hash_once() throws Exception { StaticJenkinsAPIs jenkinsAPIs = withPublicKey(PUBLIC_KEY); BuildMonitorInstallation installation = new BuildMonitorInstallation(jenkinsAPIs); installation.anonymousCorrelationId(); installation.anonymousCorrelationId(); verify(jenkinsAPIs, times(1)).encodedPublicKey(); }