* {@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
*/
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());
@Override
public String toString() {
- final StringBuilder sb = new StringBuilder("UnmodifiableCollection{");
- sb.append(delegate);
- return sb.toString();
+ return "UnmodifiableCollection{" + delegate + "}";
}
}