[Demonstration 1]

[Buggy Method]
public static void main(final String[] args) {
    final Map<Object, Object> bt = new ConcurrentHashTrieMap<Object, Object>();
    for (int j = 0; j < 50 * 1000; j++) {
        final Object[] objects = getObjects(j);
        for (final Object o : objects) {
            bt.put(o, o);
        }
    }
    {
        final ExecutorService es = Executors.newFixedThreadPool(NTHREADS);
        for (int i = 0; i < NTHREADS; i++) {
            final int threadNo = i;
            es.execute(new Runnable() {

                @Override
                public void run() {
                    for (final Iterator<Map.Entry<Object, Object>> i = bt.entrySet().iterator(); i.hasNext(); ) {
                        final Entry<Object, Object> e = i.next();
                        if (accepts(threadNo, NTHREADS, e.getKey())) {
                            e.setValue("TEST:" + threadNo);
                        }
                    }
                }
            });
        }
        es.shutdown();
        try {
            es.awaitTermination(3600L, TimeUnit.SECONDS);
        } catch (final InterruptedException e) {
            e.printStackTrace();
        }
    }
    int count = 0;
    for (final Object value : bt.values()) {
        TestHelper.assertTrue(value instanceof String);
        count++;
    }
    TestHelper.assertEquals(50000 + 2000 + 1000 + 100, count);
    final ConcurrentHashMap<Object, Object> removed = new ConcurrentHashMap<Object, Object>();
    {
        final ExecutorService es = Executors.newFixedThreadPool(NTHREADS);
        for (int i = 0; i < NTHREADS; i++) {
            final int threadNo = i;
            es.execute(new Runnable() {

                @Override
                public void run() {
                    for (final Iterator<Map.Entry<Object, Object>> i = bt.entrySet().iterator(); i.hasNext(); ) {
                        final Entry<Object, Object> e = i.next();
                        Object key = e.getKey();
                        if (accepts(threadNo, NTHREADS, key)) {
                            if (null == bt.get(key)) {
                                System.out.println(key);
                            }
                            i.remove();
                            if (null != bt.get(key)) {
                                System.out.println(key);
                            }
                            removed.put(key, key);
                        }
                    }
                }
            });
        }
        es.shutdown();
        try {
            es.awaitTermination(3600L, TimeUnit.SECONDS);
        } catch (final InterruptedException e) {
            e.printStackTrace();
        }
    }
    count = 0;
    for (final Object value : bt.keySet()) {
        value.toString();
        count++;
    }
    for (final Object o : bt.keySet()) {
        if (!removed.contains(bt.get(o))) {
            System.out.println();
        }
    }
    TestHelper.assertEquals(0, count);
    TestHelper.assertEquals(0, bt.size());
    TestHelper.assertTrue(bt.isEmpty());
}

[Buggy Hunk]
System.out.println ();

[Patch]
System.out.println ("Not removed: " + o);

[Demonstration 2]

[Buggy Method]
public void remove(TrainsCycleItem item) {
    for (TimeInterval key : map.keys()) {
        map.remove(key, item);
    }
}

[Buggy Hunk]
for (TimeInterval key : map.keys()) {

[Patch]
for (TimeInterval key : new ArrayList<>(map.keys())) {

[Demonstration 3]

[Buggy Method]
protected void setContentRoot(FrameLayout contentRoot) {
    mContentRoot = contentRoot;
}

[Buggy Hunk]
protected void setContentRoot(FrameLayout contentRoot) {

[Patch]
protected void setContentRoot(@NonNull FrameLayout contentRoot) {