### Question:
InstanceConfig extends HelixProperty { public Map<String, Integer> getInstanceCapacityMap() { Map<String, String> capacityData = _record.getMapField(InstanceConfigProperty.INSTANCE_CAPACITY_MAP.name()); if (capacityData != null) { return capacityData.entrySet().stream().collect( Collectors.toMap(entry -> entry.getKey(), entry -> Integer.parseInt(entry.getValue()))); } return Collections.emptyMap(); } InstanceConfig(String instanceId);  InstanceConfig(ZNRecord record); String getHostName(); void setHostName(String hostName); String getPort(); void setPort(String port); @Deprecated String getZoneId(); void setZoneId(String zoneId); @Deprecated String getDomain(); String getDomainAsString(); Map<String, String> getDomainAsMap(); void setDomain(String domain); int getWeight(); void setWeight(int weight); List<String> getTags(); void addTag(String tag); void removeTag(String tag); boolean containsTag(String tag); boolean getInstanceEnabled(); void setInstanceEnabled(boolean enabled); long getInstanceEnabledTime(); @Deprecated boolean getInstanceEnabledForPartition(String partition); boolean getInstanceEnabledForPartition(String resource, String partition); @Deprecated List<String> getDisabledPartitions(); List<String> getDisabledPartitions(String resourceName); Map<String, List<String>> getDisabledPartitionsMap(); @Deprecated void setInstanceEnabledForPartition(String partitionName, boolean enabled); void setInstanceEnabledForPartition(String resourceName, String partitionName,
      boolean enabled); boolean isInstanceInDomain(String domain); boolean isDelayRebalanceEnabled(); void setDelayRebalanceEnabled(boolean enabled); int getMaxConcurrentTask(); void setMaxConcurrentTask(int maxConcurrentTask); int getTargetTaskThreadPoolSize(); void setTargetTaskThreadPoolSize(int targetTaskThreadPoolSize); Map<String, Integer> getInstanceCapacityMap(); void setInstanceCapacityMap(Map<String, Integer> capacityDataMap); @Override boolean equals(Object obj); @Override int hashCode(); String getInstanceName(); @Override boolean isValid(); static InstanceConfig toInstanceConfig(String instanceId); boolean validateTopologySettingInInstanceConfig(ClusterConfig clusterConfig,
      String instanceName); static final int WEIGHT_NOT_SET; static final int MAX_CONCURRENT_TASK_NOT_SET; }### Answer:
@Test public void testGetInstanceCapacityMap() { Map<String, Integer> capacityDataMap = ImmutableMap.of("item1", 1, "item2", 2, "item3", 3); Map<String, String> capacityDataMapString = ImmutableMap.of("item1", "1", "item2", "2", "item3", "3"); ZNRecord rec = new ZNRecord("testId"); rec.setMapField(InstanceConfig.InstanceConfigProperty.INSTANCE_CAPACITY_MAP.name(), capacityDataMapString); InstanceConfig testConfig = new InstanceConfig(rec); Assert.assertTrue(testConfig.getInstanceCapacityMap().equals(capacityDataMap)); }