### Question:
MetadataIdentificationUtils { public static String create(final Class<?> metadataClass) { if (metadataClass == null) { return null; } return create(metadataClass.getName()); } private  MetadataIdentificationUtils(); static String create(final Class<?> metadataClass); static String create(final String fullyQualifiedClassName); static String create(final String fullyQualifiedMetadataClass,
      final String instanceIdentificationKey); static String getMetadataClass(final String metadataId); static String getMetadataClassId(final String metadataId); static String getMetadataInstance(final String metadataId); static boolean isIdentifyingClass(final String metadataIdentificationString); static boolean isIdentifyingInstance(final String metadataIdentificationString); static boolean isValid(final String metadataIdentificationString);  }### Answer:
@Test public void testClassIdFromNullMetadataClassName() { assertNull(MetadataIdentificationUtils.create((String) null)); }
@Test public void testClassIdFromWellFormedMetadataClassName() { assertEquals(MID_PREFIX + METADATA_CLASS, MetadataIdentificationUtils.create(METADATA_CLASS)); }
@Test public void testInstanceIdFromNullInstanceKey() { assertNull(MetadataIdentificationUtils.create(METADATA_CLASS, null)); }
@Test public void testInstanceIdFromValidInputs() { assertEquals(MID_PREFIX + METADATA_CLASS + INSTANCE_DELIMITER + INSTANCE_CLASS, MetadataIdentificationUtils.create(METADATA_CLASS, INSTANCE_CLASS)); }
@Test public void testMetadataIdentifierCreation() { Assert.assertEquals("MID:com.foo.Bar", MetadataIdentificationUtils.create("com.foo.Bar")); Assert.assertNull(MetadataIdentificationUtils.create((String) null)); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar#")); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar#foo")); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar # ")); Assert.assertNull(MetadataIdentificationUtils.create("")); Assert.assertNull(MetadataIdentificationUtils.create("#")); Assert.assertEquals("MID:com.foo.Bar#239", MetadataIdentificationUtils.create("com.foo.Bar", "239")); Assert.assertEquals("MID:com.foo.Bar#239 #40", MetadataIdentificationUtils.create("com.foo.Bar", "239 #40")); Assert.assertNull(MetadataIdentificationUtils.create(null, "239")); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar#", "239")); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar#foo", "239")); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar # ", "239")); Assert.assertNull(MetadataIdentificationUtils.create("", "239")); Assert.assertNull(MetadataIdentificationUtils.create("#", "239")); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar", null)); Assert.assertNull(MetadataIdentificationUtils.create("com.foo.Bar", "")); }
@Test public void testClassIdFromBadlyFormedMetadataClassName() { assertNull(MetadataIdentificationUtils.create("foo#bar")); }
@Test public void testClassIdFromEmptyMetadataClassName() { assertNull(MetadataIdentificationUtils.create("")); }
@Test public void testClassIdFromNonNullMetadataClass() { assertEquals(CLASS_MID, MetadataIdentificationUtils.create(MetadataItem.class)); }
@Test public void testClassIdFromNullMetadataClass() { assertNull(MetadataIdentificationUtils.create((Class<?>) null)); }