David M. Lloyd wrote:
BTW, I'm sceptical about the claims within the javadoc for singleton()
that the resultant set is serializable, as the field containing the
element is final.
final is fine with serialisation. You can even provide a readObject and
set it with ObjectInputStream.readObject
Just a random thought I had. Why not add methods to create two- or
three-element sets in the same spirit as Set singleton(T)? The idea
could be expanded beyond three elements but I think the initial comparisons
would get too complex.
Also fixes a javadoc nit in singleton().
BTW, I'm sceptic
Changeset: a99a2d2f3249
Author:dfuchs
Date: 2008-12-04 17:58 +0100
URL: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/a99a2d2f3249
6319823: new mbean register/unregister notification for groups of mbeans
6779698: Merge error caused duplicate example code in MBeanServerNotification
Revi