@Test public void testVoid() { MyInterface myInterface = mock(MyInterface.class); try { myInterface.put(new Object()); } catch (Exception e) { e.printStackTrace(); } }