Generally, you don't need to mock immutable objects that have no side effects, just as you wouldn't mock Math.max
On Wed, Feb 16, 2011 at 11:09 AM, Fabrizio Giudici <[email protected]> wrote: > On 02/16/2011 11:36 AM, Kevin Wright wrote: >> >> >> The naming convention is also prone to misunderstanding. Head/Tail smells >> a lot like a linked list, which perhaps gives the wrong impression, and >> breaks down quite rapidly when considering larger tuples. I also think that >> the getters could be dropped entirely in favour of public final fields. >> This is increasingly being recognized as a best practice when writing >> immutable objects as it leads to far cleaner code. > > I've tried that, but gave up: how do you use Mockito with public final > fields? > > -- > Fabrizio Giudici - Java Architect, Project Manager > Tidalwave s.a.s. - "We make Java work. Everywhere." > java.net/blog/fabriziogiudici - www.tidalwave.it/people > [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > > -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
