Search in sources :

Example 16 with Supplier

use of java8.util.function.Supplier in project streamsupport by stefan-zobel.

the class Collection8Test method testObjectMethods.

@Test(dataProvider = "Source")
public void testObjectMethods(String description, Supplier<CollectionImplementation> sci) {
    ThreadLocalRandom rnd = ThreadLocalRandom.current();
    Collection c = sci.get().emptyCollection();
    for (int n = rnd.nextInt(3); n-- > 0; ) c.add(sci.get().makeElement(rnd.nextInt()));
    assertEquals(c, c);
    if (c instanceof List) {
        List<?> copy = new ArrayList(c);
        assertEquals(copy, c);
        assertEquals(c, copy);
        assertEquals(copy.hashCode(), c.hashCode());
    }
    if (c instanceof Set) {
        Set<?> copy = new HashSet(c);
        assertEquals(copy, c);
        assertEquals(c, copy);
        assertEquals(copy.hashCode(), c.hashCode());
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) ArrayList(java.util.ArrayList) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) Collection(java.util.Collection) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) HashSet(java.util.HashSet) Test(org.testng.annotations.Test)

Example 17 with Supplier

use of java8.util.function.Supplier in project streamsupport by stefan-zobel.

the class Collection8Test method testForEachRemainingConsistentWithDefaultImplementation.

/**
 * Iterator.forEachRemaining has same behavior as Iterator's
 * default implementation.
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test(dataProvider = "Source")
public void testForEachRemainingConsistentWithDefaultImplementation(String description, Supplier<CollectionImplementation> sci) {
    CollectionImplementation impl = sci.get();
    Collection c = impl.emptyCollection();
    if (!testImplementationDetails || c.getClass() == java.util.LinkedList.class)
        return;
    ThreadLocalRandom rnd = ThreadLocalRandom.current();
    int n = 1 + rnd.nextInt(3);
    for (int i = 0; i < n; i++) c.add(impl.makeElement(i));
    ArrayList iterated = new ArrayList();
    ArrayList iteratedForEachRemaining = new ArrayList();
    Iterator<?> it1 = c.iterator();
    Iterator<?> it2 = c.iterator();
    assertTrue(it1.hasNext());
    assertTrue(it2.hasNext());
    c.clear();
    Object r1, r2;
    try {
        while (it1.hasNext()) iterated.add(it1.next());
        r1 = iterated;
    } catch (ConcurrentModificationException ex) {
        r1 = ConcurrentModificationException.class;
        assertFalse(impl.isConcurrent());
    }
    try {
        Iterators.forEachRemaining(it2, iteratedForEachRemaining::add);
        r2 = iteratedForEachRemaining;
    } catch (ConcurrentModificationException ex) {
        r2 = ConcurrentModificationException.class;
        assertFalse(impl.isConcurrent());
    }
    assertEquals(r1, r2);
}
Also used : ConcurrentModificationException(java.util.ConcurrentModificationException) ArrayList(java.util.ArrayList) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Collection(java.util.Collection) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) LinkedList(java.util.LinkedList) Test(org.testng.annotations.Test)

Example 18 with Supplier

use of java8.util.function.Supplier in project streamsupport by stefan-zobel.

the class Collection8Test method testRemoveIf.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Test(dataProvider = "Source")
public void testRemoveIf(String description, Supplier<CollectionImplementation> sci) {
    CollectionImplementation impl = sci.get();
    if (CopyOnWriteArrayList.class.equals(impl.klazz()) || CopyOnWriteArraySet.class.equals(impl.klazz())) {
        return;
    }
    Collection c = impl.emptyCollection();
    boolean ordered = Spliterators.spliterator(c).hasCharacteristics(Spliterator.ORDERED);
    ThreadLocalRandom rnd = ThreadLocalRandom.current();
    int n = rnd.nextInt(6);
    for (int i = 0; i < n; i++) c.add(impl.makeElement(i));
    AtomicReference threwAt = new AtomicReference<>(null);
    List<?> orig = rnd.nextBoolean() ? new ArrayList<>(c) : Arrays.asList(c.toArray());
    // Merely creating an iterator can change ArrayBlockingQueue behavior
    Iterator<?> it = rnd.nextBoolean() ? c.iterator() : null;
    ArrayList survivors = new ArrayList<>();
    ArrayList accepts = new ArrayList<>();
    ArrayList rejects = new ArrayList<>();
    Predicate randomPredicate = e -> {
        assertNull(threwAt.get());
        switch(rnd.nextInt(3)) {
            case 0:
                accepts.add(e);
                return true;
            case 1:
                rejects.add(e);
                return false;
            case 2:
                threwAt.set(e);
                throw new ArithmeticException();
            default:
                throw new AssertionError();
        }
    };
    try {
        try {
            boolean modified = Iterables.removeIf(c, randomPredicate);
            assertNull(threwAt.get());
            assertEquals(modified, accepts.size() > 0);
            assertEquals(modified, rejects.size() != n);
            assertEquals(accepts.size() + rejects.size(), n);
            if (ordered) {
                assertEquals(rejects, Arrays.asList(c.toArray()));
            } else {
                assertEquals(new HashSet<>(rejects), new HashSet<>(Arrays.asList(c.toArray())));
            }
        } catch (ArithmeticException ok) {
            assertNotNull(threwAt.get());
            assertTrue(c.contains(threwAt.get()));
        }
        if (it != null && impl.isConcurrent())
            // check for weakly consistent iterator
            while (it.hasNext()) assertTrue(orig.contains(it.next()));
        switch(rnd.nextInt(4)) {
            case 0:
                survivors.addAll(c);
                break;
            case 1:
                survivors.addAll(Arrays.asList(c.toArray()));
                break;
            case 2:
                Iterables.forEach(c, survivors::add);
                break;
            case 3:
                for (Object e : c) survivors.add(e);
                break;
        }
        assertTrue(orig.containsAll(accepts));
        assertTrue(orig.containsAll(rejects));
        assertTrue(orig.containsAll(survivors));
        assertTrue(orig.containsAll(c));
        assertTrue(c.containsAll(rejects));
        assertTrue(c.containsAll(survivors));
        assertTrue(survivors.containsAll(rejects));
        if (threwAt.get() == null) {
            assertEquals(n - accepts.size(), c.size());
            for (Object x : accepts) assertFalse(c.contains(x));
        } else {
            // Two acceptable behaviors: entire removeIf call is one
            // transaction, or each element processed is one transaction.
            assertTrue(n == c.size() || n == c.size() + accepts.size());
            int k = 0;
            for (Object x : accepts) if (c.contains(x))
                k++;
            assertTrue(k == accepts.size() || k == 0);
        }
    } catch (Throwable ex) {
        System.err.println(impl.klazz());
        // c is at risk of corruption if we got here, so be lenient
        try {
            System.err.printf("c=%s%n", c);
        } catch (Throwable t) {
            t.printStackTrace();
        }
        System.err.printf("n=%d%n", n);
        System.err.printf("orig=%s%n", orig);
        System.err.printf("accepts=%s%n", accepts);
        System.err.printf("rejects=%s%n", rejects);
        System.err.printf("survivors=%s%n", survivors);
        System.err.printf("threwAt=%s%n", threwAt.get());
        throw ex;
    }
}
Also used : Arrays(java.util.Arrays) DataProvider(org.testng.annotations.DataProvider) PriorityQueue(java.util.PriorityQueue) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Test(org.testng.annotations.Test) Iterables(java8.lang.Iterables) Deque(java.util.Deque) Predicate(java8.util.function.Predicate) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) PriorityBlockingQueue(java.util.concurrent.PriorityBlockingQueue) HashSet(java.util.HashSet) Phaser(java8.util.concurrent.Phaser) Iterators(java8.util.Iterators) Future(java.util.concurrent.Future) J8Arrays(java8.util.J8Arrays) Vector(java.util.Vector) Consumer(java8.util.function.Consumer) LinkedList(java.util.LinkedList) NoSuchElementException(java.util.NoSuchElementException) ExecutorService(java.util.concurrent.ExecutorService) Iterator(java.util.Iterator) BlockingDeque(java.util.concurrent.BlockingDeque) Collection(java.util.Collection) Spliterator(java8.util.Spliterator) Set(java.util.Set) BlockingQueue(java.util.concurrent.BlockingQueue) Collectors(java8.util.stream.Collectors) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Spliterators(java8.util.Spliterators) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) StreamSupport(java8.util.stream.StreamSupport) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Executors(java.util.concurrent.Executors) Supplier(java8.util.function.Supplier) CountDownLatch(java.util.concurrent.CountDownLatch) AtomicLong(java.util.concurrent.atomic.AtomicLong) List(java.util.List) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) HOURS(java.util.concurrent.TimeUnit.HOURS) Queue(java.util.Queue) ArrayDeque(java.util.ArrayDeque) Collections(java.util.Collections) ConcurrentModificationException(java.util.ConcurrentModificationException) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) AtomicReference(java.util.concurrent.atomic.AtomicReference) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) Predicate(java8.util.function.Predicate) Collection(java.util.Collection) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Test(org.testng.annotations.Test)

Example 19 with Supplier

use of java8.util.function.Supplier in project streamsupport by stefan-zobel.

the class Collection8Test method testDetectRaces.

/**
 * Motley crew of threads concurrently randomly hammer the collection.
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test(dataProvider = "Source")
public void testDetectRaces(String description, Supplier<CollectionImplementation> sci) throws Throwable {
    CollectionImplementation impl = sci.get();
    if (!impl.isConcurrent())
        return;
    if (HAS_JAVA8_SPLITERATOR_BUG && LinkedBlockingDeque.class.equals(impl.klazz())) {
        // https://bugs.openjdk.java.net/browse/JDK-8169739
        return;
    }
    if (CopyOnWriteArraySet.class.equals(impl.klazz())) {
        return;
    }
    final ThreadLocalRandom rnd = ThreadLocalRandom.current();
    final Collection c = impl.emptyCollection();
    final long testDurationMillis = expensiveTests ? LONG_DELAY_MS : timeoutMillis();
    final AtomicBoolean done = new AtomicBoolean(false);
    final Object one = impl.makeElement(1);
    final Object two = impl.makeElement(2);
    final Consumer checkSanity = x -> assertTrue(x == one || x == two);
    final Consumer<Object[]> checkArraySanity = array -> {
        // assertTrue(array.length <= 2); // duplicates are permitted
        for (Object x : array) assertTrue(x == one || x == two);
    };
    final Object[] emptyArray = (Object[]) java.lang.reflect.Array.newInstance(one.getClass(), 0);
    final List<Future<?>> futures;
    // register this thread
    final Phaser threadsStarted = new Phaser(1);
    final Runnable[] frobbers = { () -> Iterables.forEach(c, checkSanity), () -> StreamSupport.stream(c).forEach(checkSanity), () -> StreamSupport.parallelStream(c).forEach(checkSanity), () -> Spliterators.spliterator(c).trySplit(), () -> {
        Spliterator<?> s = Spliterators.spliterator(c);
        s.tryAdvance(checkSanity);
        s.trySplit();
    }, () -> {
        Spliterator<?> s = Spliterators.spliterator(c);
        do {
        } while (s.tryAdvance(checkSanity));
    }, () -> {
        for (Object x : c) checkSanity.accept(x);
    }, () -> checkArraySanity.accept(c.toArray()), () -> checkArraySanity.accept(c.toArray(emptyArray)), () -> {
        Object[] a = new Object[5];
        Object three = impl.makeElement(3);
        Arrays.fill(a, 0, a.length, three);
        Object[] x = c.toArray(a);
        if (x == a)
            for (int i = 0; i < a.length && a[i] != null; i++) checkSanity.accept(a[i]);
        else
            // A careful reading of the spec does not support:
            // for (i++; i < a.length; i++) assertSame(three, a[i]);
            checkArraySanity.accept(x);
    }, adderRemover(c, one), adderRemover(c, two) };
    final List<Runnable> tasks = J8Arrays.stream(frobbers).filter(// random subset
    task -> rnd.nextBoolean()).map(task -> (Runnable) () -> {
        threadsStarted.arriveAndAwaitAdvance();
        while (!done.get()) task.run();
    }).collect(Collectors.<Runnable>toList());
    final ExecutorService pool = Executors.newCachedThreadPool();
    PoolCleaner cleaner = null;
    try {
        cleaner = cleaner(pool, done);
        threadsStarted.bulkRegister(tasks.size());
        futures = StreamSupport.stream(tasks).map(pool::submit).collect(Collectors.toList());
        threadsStarted.arriveAndDeregister();
        Thread.sleep(testDurationMillis);
    } finally {
        if (cleaner != null) {
            cleaner.close();
        }
    }
    for (Future<?> future : futures) assertNull(future.get(0L, MILLISECONDS));
}
Also used : Arrays(java.util.Arrays) DataProvider(org.testng.annotations.DataProvider) PriorityQueue(java.util.PriorityQueue) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Test(org.testng.annotations.Test) Iterables(java8.lang.Iterables) Deque(java.util.Deque) Predicate(java8.util.function.Predicate) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) PriorityBlockingQueue(java.util.concurrent.PriorityBlockingQueue) HashSet(java.util.HashSet) Phaser(java8.util.concurrent.Phaser) Iterators(java8.util.Iterators) Future(java.util.concurrent.Future) J8Arrays(java8.util.J8Arrays) Vector(java.util.Vector) Consumer(java8.util.function.Consumer) LinkedList(java.util.LinkedList) NoSuchElementException(java.util.NoSuchElementException) ExecutorService(java.util.concurrent.ExecutorService) Iterator(java.util.Iterator) BlockingDeque(java.util.concurrent.BlockingDeque) Collection(java.util.Collection) Spliterator(java8.util.Spliterator) Set(java.util.Set) BlockingQueue(java.util.concurrent.BlockingQueue) Collectors(java8.util.stream.Collectors) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Spliterators(java8.util.Spliterators) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) StreamSupport(java8.util.stream.StreamSupport) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Executors(java.util.concurrent.Executors) Supplier(java8.util.function.Supplier) CountDownLatch(java.util.concurrent.CountDownLatch) AtomicLong(java.util.concurrent.atomic.AtomicLong) List(java.util.List) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) HOURS(java.util.concurrent.TimeUnit.HOURS) Queue(java.util.Queue) ArrayDeque(java.util.ArrayDeque) Collections(java.util.Collections) ConcurrentModificationException(java.util.ConcurrentModificationException) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Consumer(java8.util.function.Consumer) ExecutorService(java.util.concurrent.ExecutorService) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) Collection(java.util.Collection) Future(java.util.concurrent.Future) Phaser(java8.util.concurrent.Phaser) Test(org.testng.annotations.Test)

Example 20 with Supplier

use of java8.util.function.Supplier in project streamsupport by stefan-zobel.

the class Collection8Test method testRandomElementRemovalDuringTraversal.

/**
 * Some elements randomly disappear in the middle of traversal.
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test(dataProvider = "Source")
public void testRandomElementRemovalDuringTraversal(String description, Supplier<CollectionImplementation> sci) {
    CollectionImplementation impl = sci.get();
    if (CopyOnWriteArrayList.class.equals(impl.klazz()) || CopyOnWriteArraySet.class.equals(impl.klazz())) {
        return;
    }
    if (HAS_JAVA8_SPLITERATOR_BUG && (LinkedBlockingDeque.class.equals(impl.klazz())) || LinkedBlockingQueue.class.equals(impl.klazz())) {
        // https://bugs.openjdk.java.net/browse/JDK-8171051
        return;
    }
    Collection c = impl.emptyCollection();
    ThreadLocalRandom rnd = ThreadLocalRandom.current();
    int n = rnd.nextInt(6);
    ArrayList copy = new ArrayList();
    for (int i = 0; i < n; i++) {
        Object x = impl.makeElement(i);
        copy.add(x);
        c.add(x);
    }
    ArrayList iterated = new ArrayList();
    ArrayList spliterated = new ArrayList();
    ArrayList removed = new ArrayList();
    Spliterator<?> s = Spliterators.spliterator(c);
    Iterator<?> it = c.iterator();
    if (!(s.hasCharacteristics(Spliterator.CONCURRENT) || s.hasCharacteristics(Spliterator.IMMUTABLE)))
        return;
    for (int i = rnd.nextInt(n + 1); --i >= 0; ) {
        assertTrue(s.tryAdvance(e -> {
        }));
        if (rnd.nextBoolean())
            assertTrue(it.hasNext());
        it.next();
    }
    // TODO: many more removal methods
    if (rnd.nextBoolean()) {
        for (Iterator<?> z = c.iterator(); z.hasNext(); ) {
            Object e = z.next();
            if (rnd.nextBoolean()) {
                try {
                    z.remove();
                } catch (UnsupportedOperationException ok) {
                    return;
                }
                removed.add(e);
            }
        }
    } else {
        Predicate randomlyRemove = e -> {
            if (rnd.nextBoolean()) {
                removed.add(e);
                return true;
            } else
                return false;
        };
        Iterables.removeIf(c, randomlyRemove);
    }
    s.forEachRemaining(spliterated::add);
    while (it.hasNext()) iterated.add(it.next());
    assertTrue(copy.containsAll(iterated));
    assertTrue(copy.containsAll(spliterated));
    assertTrue(copy.containsAll(removed));
    if (s.hasCharacteristics(Spliterator.CONCURRENT)) {
        ArrayList<?> iteratedAndRemoved = new ArrayList<>(iterated);
        ArrayList<?> spliteratedAndRemoved = new ArrayList<>(spliterated);
        iteratedAndRemoved.retainAll(removed);
        spliteratedAndRemoved.retainAll(removed);
        assertTrue(iteratedAndRemoved.size() <= 1);
        assertTrue(spliteratedAndRemoved.size() <= 1);
        if (testImplementationDetails && !(c instanceof java.util.concurrent.ArrayBlockingQueue))
            assertTrue(spliteratedAndRemoved.isEmpty());
    }
}
Also used : Arrays(java.util.Arrays) DataProvider(org.testng.annotations.DataProvider) PriorityQueue(java.util.PriorityQueue) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Test(org.testng.annotations.Test) Iterables(java8.lang.Iterables) Deque(java.util.Deque) Predicate(java8.util.function.Predicate) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) PriorityBlockingQueue(java.util.concurrent.PriorityBlockingQueue) HashSet(java.util.HashSet) Phaser(java8.util.concurrent.Phaser) Iterators(java8.util.Iterators) Future(java.util.concurrent.Future) J8Arrays(java8.util.J8Arrays) Vector(java.util.Vector) Consumer(java8.util.function.Consumer) LinkedList(java.util.LinkedList) NoSuchElementException(java.util.NoSuchElementException) ExecutorService(java.util.concurrent.ExecutorService) Iterator(java.util.Iterator) BlockingDeque(java.util.concurrent.BlockingDeque) Collection(java.util.Collection) Spliterator(java8.util.Spliterator) Set(java.util.Set) BlockingQueue(java.util.concurrent.BlockingQueue) Collectors(java8.util.stream.Collectors) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Spliterators(java8.util.Spliterators) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) StreamSupport(java8.util.stream.StreamSupport) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Executors(java.util.concurrent.Executors) Supplier(java8.util.function.Supplier) CountDownLatch(java.util.concurrent.CountDownLatch) AtomicLong(java.util.concurrent.atomic.AtomicLong) List(java.util.List) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) HOURS(java.util.concurrent.TimeUnit.HOURS) Queue(java.util.Queue) ArrayDeque(java.util.ArrayDeque) Collections(java.util.Collections) ConcurrentModificationException(java.util.ConcurrentModificationException) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) ArrayList(java.util.ArrayList) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Predicate(java8.util.function.Predicate) Collection(java.util.Collection) ThreadLocalRandom(java8.util.concurrent.ThreadLocalRandom) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)16 Collection (java.util.Collection)14 LinkedList (java.util.LinkedList)13 ThreadLocalRandom (java8.util.concurrent.ThreadLocalRandom)13 Supplier (java8.util.function.Supplier)13 ArrayList (java.util.ArrayList)12 List (java.util.List)12 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)12 ArrayDeque (java.util.ArrayDeque)11 Deque (java.util.Deque)11 HashSet (java.util.HashSet)11 BlockingDeque (java.util.concurrent.BlockingDeque)11 LinkedBlockingDeque (java.util.concurrent.LinkedBlockingDeque)11 Spliterator (java8.util.Spliterator)11 StreamSupport (java8.util.stream.StreamSupport)11 Arrays (java.util.Arrays)10 ConcurrentModificationException (java.util.ConcurrentModificationException)10 Iterator (java.util.Iterator)10 Set (java.util.Set)10 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)10