ClassName { public static String getInterfaceName(String className) { String packageName = getPackage(className); if (StringUtils.isEmpty(packageName) || Constants.PackagesGenerated.ENTITY.equals(packageName)) { return String.format("%s.%sService", Constants.PackagesGenerated.SERVICE, getSimpleName(className)); } else { return String.format("%s.mdsservice.%sService", packageName, getSimpleName(className)); } } private  ClassName(); static String getSimpleName(String className); static String getPackage(String className); static String getHistoryClassName(String className); static String getTrashClassName(String className); static String getEntityClassName(String simpleName); static String getRepositoryName(String className); static String getInterfaceName(String className); static String getServiceClassName(String className); static String getServiceName(String className); static String trimTrashHistorySuffix(String name); static String getEntityTypeSuffix(String name); static boolean isTrashClassName(String className); static boolean isHistoryClassName(String className); static String restId(String entityName, String module, String namespace); static String restUrl(String entityName, String entityModule, String entityNamespace); static String restLookupUrl(String entityName, String entityModule, String entityNamespace,
                                       String lookupMethodName); static String simplifiedModuleName(String moduleName); static String getEnumPackage(String className);  }
@Test public void shouldGenerateCorrectInterfaceNames() { assertEquals("org.motechproject.mds.entity.service.ExampleService", ClassName.getInterfaceName("Example")); assertEquals("org.motechproject.mds.entity.service.EntityService", ClassName.getInterfaceName("Entity")); assertEquals("org.motechproject.admin.mds.mdsservice.UserService", ClassName.getInterfaceName("org.motechproject.admin.mds.User")); assertEquals("org.motechproject.email.domain.mdsservice.EmailService", ClassName.getInterfaceName("org.motechproject.email.domain.Email")); }