PrivateMethodDemo tested = spy(new PrivateMethodDemo());
assertEquals("Hello Temp, you are 50 old.", tested.sayYear("Temp", 50));
when(tested, "doSayYear", Mockito.anyInt(), Mockito.anyString()).thenReturn("another");
assertEquals("another", tested.sayYear("Johan", 29));
assertEquals("another", tested.sayYear("test", 12));
verifyPrivate(tested).invoke("doSayYear", 29, "Johan");
verifyPrivate(tested).invoke("doSayYear", 12, "test");
verifyPrivate(tested).invoke("doSayYear", 50, "Temp");