### Question:
GlobalUtils { public static String createMethodName(final String name) { String myName = name; if (Strings.isNullOrEmpty(myName) || myName.trim().equals(":")) { return EssentialConst.INVALID_METHOD_NAME; } myName = CharMatcher.WHITESPACE.removeFrom(myName); final int index = myName.indexOf(':'); if (index == -1 || index == myName.length() - 1) { return PREFIX_GET + capitalize(myName.replace(':', ' ').trim()); } final String[] parts = NAMESPACE_PATTERN.split(myName); if (parts.length < 1) { return EssentialConst.INVALID_METHOD_NAME; } return PREFIX_GET + capitalize(parts[1]); } private  GlobalUtils(); static String replacePlaceholders(final String input, final String placeholder, final String replacement); static String readStreamAsText(final InputStream stream); static void populateDirectories(final Path startPath, final List<Path> existing); static StringBuilder readTextFile(final Path path); static void writeToFile(final CharSequence content, final Path path); static String createMethodName(final String name); static String createClassName(final String input); static String getNamespacePrefix(final String fullName); static String getNameAfterPrefix(final String fullName); @SuppressWarnings("HippoHstCallNodeRefreshInspection") static void refreshSession(final Session session, final boolean keepChanges); static Session createSession(); static void cleanupSession(final Session session); static T newInstance(final Class<T> clazz); @SuppressWarnings("unchecked") static T newInstance(final String className); static Class<?> loadCLass(final String clazz); static String decodeUrl(final String url); static String validFileName(final String input); static boolean marshalWriter(final Writer writer, final Document document); @SuppressWarnings("unchecked") static T unmarshalStream(final InputStream stream, final Class<T> clazz);  }### Answer:
@Test public void testGenerateMethodName() throws Exception { String name = GlobalUtils.createMethodName(null); assertEquals(EssentialConst.INVALID_METHOD_NAME, name); name = GlobalUtils.createMethodName(":"); assertEquals(EssentialConst.INVALID_METHOD_NAME, name); name = GlobalUtils.createMethodName("foo"); assertEquals("getFoo", name); name = GlobalUtils.createMethodName("foo:"); assertEquals("getFoo", name); name = GlobalUtils.createMethodName("foo:"); assertEquals("getFoo", name); name = GlobalUtils.createMethodName("foo:bar"); assertEquals("getBar", name); name = GlobalUtils.createMethodName("::::::"); assertEquals(EssentialConst.INVALID_METHOD_NAME, name); name = GlobalUtils.createMethodName("foo bar id"); assertEquals("getFoobarid", name); }