Support testing null against null in equalsHelper()
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / UnmodifiableCollection.java
index 9d5cfe1a72af84c5d2c48aa33c4892e496d8d9d4..29ccab5e40bc8c47def2672676457a7a4df3f868 100644 (file)
@@ -24,10 +24,9 @@ import javax.annotation.Nonnull;
  * {@link Collections#unmodifiableCollection(Collection)}, this class checks its
  * argument to ensure multiple encapsulation does not occur.
  *
- * this class checks
+ * <p>This class checks
  * the argument so it prevents multiple encapsulation. Subclasses of
  * {@link ImmutableCollection} are also recognized and not encapsulated.
- * An attempt is also made to identi
  *
  * @param <E> the type of elements in this collection
  */
@@ -37,7 +36,7 @@ public final class UnmodifiableCollection<E> implements Collection<E>, Serializa
     private static final Collection<Class<?>> SINGLETON_CLASSES;
 
     static {
-        UNMODIFIABLE_COLLECTION_CLASS = Collections.unmodifiableCollection(new ArrayList<Object>()).getClass();
+        UNMODIFIABLE_COLLECTION_CLASS = Collections.unmodifiableCollection(new ArrayList<>()).getClass();
 
         final Builder<Class<?>> b = ImmutableSet.builder();
         b.add(Collections.singleton(null).getClass());
@@ -136,8 +135,6 @@ public final class UnmodifiableCollection<E> implements Collection<E>, Serializa
 
     @Override
     public String toString() {
-        final StringBuilder sb = new StringBuilder("UnmodifiableCollection{");
-        sb.append(delegate);
-        return sb.toString();
+        return "UnmodifiableCollection{" + delegate + "}";
     }
 }