### Question:
MetricKey implements IHasShortcut { public static MetricKey fromValue(MetricSpecification spec) { MetricKey key = new MetricKey(); key.metric = spec.getMetricOrName(); key.name = spec.getNameOrMetric(); key.id = spec.getId(); if (spec.getTags() != null && spec.getTags().size() > 0) { key.tags = Tags.fromValue(spec.getTags()); } return key; }  @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCode(); static MetricKey fromValue(MetricSpecification spec); static MetricKey fromValue(String name, String metric, String tags); String toString(); @Override String getShortcut();  }### Answer:
@Test public void testFromValue() throws Exception { MetricKey victim = MetricKey.fromValue(basicName, basicMetric, basicTag); assertTrue("Name was not same as passed to fromValue().", Objects.equal(victim.getName(), basicName)); assertTrue("MetricName was not same as passed to fromValue().", Objects.equal(victim.getMetric(), basicMetric)); assertTrue("Tags value was not same as passed to fromValue().", Objects.equal(victim.getTags(), basicTagValue)); }