### Question:
MyClass1 { static String hello(String arg) { return "Hello " + arg; }  String nonStaticHello(String arg); String goodByeWrapper(String arg);  }### Answer:
@Test public void testStubbingStaticMethod() throws Exception { stub(method(MyClass1.class, "hello")).toReturn("Hello World"); assertEquals("Hello World", MyClass1.hello("Frank Oh")); }
@Test public void testReplacingStaticMethod() throws Exception { replace(method(MyClass1.class, "hello")).with( new InvocationHandler() { public Object invoke(Object object, Method method, Object[] arguments) throws Throwable { if (arguments[0].equals("John")) { return "Hello John, you are awesome!"; } else { return method.invoke(object, arguments); } } }); assertEquals("Hello Someone", MyClass1.hello("Someone")); assertEquals("Hello John, you are awesome!", MyClass1.hello("John")); }