How is whenReturn/willReturn is used while we can give any arbitrary value to the stub we created via @Mock that inserted/injected to concrete class?

How is whenReturn/willReturn is used while we can give any arbitrary value to the mock created via @Mock and added to concrete class? Edit:As far as i got JB Nizet’s answer and this one, i got assigning a value to mock and asserting that value does not test anything but there are so many examples…

Details

Goroutine concept

What are the basic differences between below two codes? Somehow, in the second example demo_process2() is never called but it works fine in the first example. 1. go func() { Must(demo_process1()) }() demo_process2() 2. go Must(demo_process1()) demo_process2() where Must(): func Must(err error) { if err != nil { panic(err) } }

Details