code: @SuppressWarnings("unchecked")
  	private static Method findMainMethod(Class clazz) {
  		try {
  			Method mainMethod = clazz.getMethod("main", new Class[] { String[].class });
  			int modifiers = mainMethod.getModifiers();
  			if (Modifier.isPublic(modifiers) && 
  				Modifier.isStatic(modifiers)) {
  				return mainMethod;
  			}
  		} catch (NoSuchMethodException nsme) {
  		}
  		return null;
  	}
docs: find public static void main(String[]) method, if any