### Question:
HeatBridgeUtils { public static Optional<String> getMatchingPserverPifName(@Nonnull final String physicalNetworkName) { Preconditions.checkState(!Strings.isNullOrEmpty(physicalNetworkName), "Physical network name is null or empty!"); if (physicalNetworkName.contains(OS_SIDE_DEDICATED_SRIOV_PREFIX)) { return Optional.of( physicalNetworkName.replace(OS_SIDE_DEDICATED_SRIOV_PREFIX, COMPUTE_SIDE_DEDICATED_SRIOV_PREFIX)); } else if (physicalNetworkName.contains(OS_SIDE_SHARED_SRIOV_PREFIX)) { return Optional .of(physicalNetworkName.replace(OS_SIDE_SHARED_SRIOV_PREFIX, COMPUTE_SIDE_SHARED_SRIOV_PREFIX)); } return Optional.of(physicalNetworkName); } private  HeatBridgeUtils(); static Optional<String> getMatchingPserverPifName(@Nonnull final String physicalNetworkName); static List<String> extractPciIdsFromVServer(Vserver vserver);  }### Answer:
@Test(expected = IllegalStateException.class) public void matchServerName_canNotBeNull() { HeatBridgeUtils.getMatchingPserverPifName(null); }
@Test public void matchServerName_isDedicated() { Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("dedicated-testServer"); assertThat(serverName).isNotEmpty().hasValue("sriov-d-testServer"); }
@Test public void matchServerName_isShared() { Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("shared-testServer"); assertThat(serverName).isNotEmpty().hasValue("sriov-s-testServer"); }
@Test public void matchServerName_unknown() { Optional<String> serverName = HeatBridgeUtils.getMatchingPserverPifName("differentServerName"); assertThat(serverName).isNotEmpty().hasValue("differentServerName"); }