### Question:
ClientTypeUtility { public static String extractClientType(Class<?> clientObjectClass) { String clientResourceType = null; final XmlRootElement xmlRootElement = clientObjectClass.getAnnotation(XmlRootElement.class); if (xmlRootElement != null && !"##default".equals(xmlRootElement.name())) { clientResourceType = xmlRootElement.name(); } else { final XmlType xmlType = clientObjectClass.getAnnotation(XmlType.class); if (xmlType != null && !"##default".equals(xmlType.name())) { clientResourceType = xmlType.name(); } } if (clientResourceType == null) { final String classSimpleName = clientObjectClass.getSimpleName(); clientResourceType = classSimpleName.replaceFirst("^.", classSimpleName.substring(0, 1).toLowerCase()); } return clientResourceType; }  static String extractClientType(Class<?> clientObjectClass);  }### Answer:
@Test public void extractClientType_XmlRootElementAnnotation() { assertEquals(NAME_FROM_XML_ROOT_ELEMENT_ANNOTATION, ClientTypeUtility.extractClientType(TestClientObjectWithXmlRootAnnotation.class)); }
@Test public void extractClientType_XmlTypeAnnotation() { assertEquals(NAME_FROM_XML_TYPE_ANNOTATION, ClientTypeUtility.extractClientType(TestClientObjectWithXmlTypeAnnotation.class)); }
@Test public void extractClientType_NoAnnotation() { assertEquals("testClientObjectWithoutAnnotation", ClientTypeUtility.extractClientType(TestClientObjectWithoutAnnotation.class)); }