### Question:
AwsInstanceView { public Double getSpotMaxPrice() { return instanceTemplate.getParameter(AwsInstanceTemplate.EC2_SPOT_MAX_PRICE, Double.class); } AwsInstanceView(InstanceTemplate instanceTemplate); List<Volume> getVolumes(); String getFlavor(); String getGroupName(); Long getPrivateId(); Long getTemplateId(); boolean isEncryptedVolumes(); boolean isKmsEnabled(); boolean isKmsDefault(); boolean isKmsCustom(); String getKmsKey(); Integer getSpotPercentage(); Double getSpotMaxPrice(); int getOnDemandPercentage(); boolean isFastEbsEncryptionEnabled();  }### Answer:
@Test public void testSpotMaxPrice() { Map<String, Object> map = new HashMap<>(); Double spotMaxPrice = 0.9; map.put(AwsInstanceTemplate.EC2_SPOT_MAX_PRICE, spotMaxPrice); InstanceTemplate instanceTemplate = new InstanceTemplate("", "", 0L, Collections.emptyList(), InstanceStatus.STARTED, map, 0L, "imageId"); AwsInstanceView actual = new AwsInstanceView(instanceTemplate); assertEquals(spotMaxPrice, actual.getSpotMaxPrice()); }
@Test public void testMissingSpotMaxPrice() { InstanceTemplate instanceTemplate = new InstanceTemplate("", "", 0L, Collections.emptyList(), InstanceStatus.STARTED, Map.of(), 0L, "imageId"); AwsInstanceView actual = new AwsInstanceView(instanceTemplate); assertNull(actual.getSpotMaxPrice()); }