### Question:
DefaultManagementMetadataProvider implements ManagementMetadataProvider { @Override public ManagementMetadata get(EurekaInstanceConfigBean instance, int serverPort, String serverContextPath, String managementContextPath, Integer managementPort) { if (isRandom(managementPort)) { return null; } if (managementPort == null && isRandom(serverPort)) { return null; } String healthCheckUrl = getHealthCheckUrl(instance, serverPort, serverContextPath, managementContextPath, managementPort, false); String statusPageUrl = getStatusPageUrl(instance, serverPort, serverContextPath, managementContextPath, managementPort); ManagementMetadata metadata = new ManagementMetadata(healthCheckUrl, statusPageUrl, managementPort == null ? serverPort : managementPort); if (instance.isSecurePortEnabled()) { metadata.setSecureHealthCheckUrl(getHealthCheckUrl(instance, serverPort, serverContextPath, managementContextPath, managementPort, true)); } return metadata; }  @Override ManagementMetadata get(EurekaInstanceConfigBean instance, int serverPort, String serverContextPath,
			String managementContextPath, Integer managementPort); String getStatusPageUrl(EurekaInstanceConfigBean instance, int serverPort, String serverContextPath,
			String managementContextPath, Integer managementPort);  }### Answer:
@Test public void serverPortIsRandomAndManagementPortIsNull() throws Exception { int serverPort = 0; String serverContextPath = "/"; String managementContextPath = null; Integer managementPort = null; ManagementMetadata actual = provider.get(INSTANCE, serverPort, serverContextPath, managementContextPath, managementPort); assertThat(actual).isNull(); }
@Test public void managementPortIsRandom() throws Exception { int serverPort = 0; String serverContextPath = "/"; String managementContextPath = null; Integer managementPort = 0; ManagementMetadata actual = provider.get(INSTANCE, serverPort, serverContextPath, managementContextPath, managementPort); assertThat(actual).isNull(); }