### Question:
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("namespace") String namespace,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("pathKey") QualifiedPathKey pathKey,
                @JsonProperty("encodedRunId") long encodedRunId);  HdfsStatsKey(HdfsStatsKey key); static long getRunId(long encodedRunId); long getRunId(); QualifiedPathKey getQualifiedPathKey(); long getEncodedRunId(); boolean hasFederatedNS(); @Override String toString(); @Override int compareTo(Object other); @Override int hashCode(); @Override boolean equals(Object other);  }### Answer:
@Test public void testConstructor1() throws Exception { HdfsStatsKey key1 = new HdfsStatsKey(cluster1, path1, now1); testKeyComponents(key1); assertEquals(key1.getQualifiedPathKey(), new QualifiedPathKey(cluster1, path1)); assertNull(key1.getQualifiedPathKey().getNamespace()); }
@Test public void testConstructorFederatedNS() throws Exception { HdfsStatsKey key1 = new HdfsStatsKey(cluster1, path1, namespace1, now1); testKeyComponents(key1); assertEquals(key1.getQualifiedPathKey(), new QualifiedPathKey(cluster1, path1, namespace1)); assertEquals(key1.getQualifiedPathKey().getNamespace(), namespace1); }
@Test public void testConstructor2() throws Exception { QualifiedPathKey qk = new QualifiedPathKey(cluster1, path1); HdfsStatsKey key1 = new HdfsStatsKey(qk, now1); testKeyComponents(key1); assertEquals(key1.getQualifiedPathKey(), qk); }