public UriProperties(String clusterName, Map<URI, Map<Integer, PartitionData>> partitionDescriptions)
  {
    this(clusterName, partitionDescriptions, Collections.<URI, Map<String, Object>>emptyMap());
  }
@Test
  public void testUriProperties()
  {
    Map<URI, Map<Integer, PartitionData>> uriData = new HashMap<>();
    uriData.put(URI_1, MAP_1);
    uriData.put(URI_2, MAP_2);
    uriData.put(URI_3, MAP_3);

    String clusterName = "TestCluster";
    UriProperties properties = new UriProperties(clusterName, uriData);

    // test construction
    Assert.assertEquals(clusterName, properties.getClusterName());
    Assert.assertEquals(properties.getPartitionDesc(), uriData);
    Assert.assertEquals(properties.Uris(), uriData.keySet());
    Assert.assertEquals(properties.getPartitionDataMap(URI_1), MAP_1);
    Assert.assertEquals(properties.getPartitionDataMap(URI_2), MAP_2);
    Assert.assertEquals(properties.getPartitionDataMap(URI_3), MAP_3);

    // test getUriBySchemeAndPartition
    Set<URI> set = new HashSet<>(1);
    set.add(URI_1);
    Assert.assertEquals(properties.getUriBySchemeAndPartition("http", 0), set);
    set.add(URI_2);
    Assert.assertEquals(properties.getUriBySchemeAndPartition("http", 1), set);
    set.clear();
    set.add(URI_3);
    Assert.assertEquals(properties.getUriBySchemeAndPartition("https", 1), set);
    Assert.assertNull(properties.getUriBySchemeAndPartition("rtp", 0));
    Assert.assertNull(properties.getUriBySchemeAndPartition("http", 2));

    // test unmodifiability
    Map<URI, Map<Integer, PartitionData>> partitionDesc = properties.getPartitionDesc();
    Map<Integer, PartitionData> partitionDataMap = properties.getPartitionDataMap(URI_1);
    URI testUri = URI.create("test");
    try
    {
      partitionDesc.put(testUri, null);
      Assert.fail("Should not be modifiable");
    }
    catch (UnsupportedOperationException ignored)
    {

    }
    try
    {
      partitionDataMap.put(1, new PartitionData(1));
      Assert.fail("Should not be modifiable");
    }
    catch (UnsupportedOperationException ignored)
    {

    }
  }