Buggy code:
public class PassivatingBackingCacheImpl < K extends Serializable , V extends Cacheable < K > , E extends BackingCacheEntry < K , V > > extends AbstractBackingCache < K , V , E > implements PassivatingBackingCache < K , V , E > { protected final Logger log = Logger . getLogger ( getClass ( ) . getName ( ) ) ; private final StatefulObjectFactory < V > factory ; private final BackingCacheEntryFactory < K , V , E > entryFactory ; private final ReplicationPassivationManager < K , E > passivationManager ; private final BackingCacheEntryStore < K , V , E > store ; private final ThreadFactory threadFactory ; private volatile ScheduledExecutorService executor ; private final Map < K , Future < ? > > expirationFutures = new ConcurrentHashMap < K , Future < ? > > ( ) ; private final Map < K , Future < ? > > passivationFutures = new ConcurrentHashMap < K , Future < ? > > ( ) ; public PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store ) { } public PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store , ThreadFactory threadFactory ) { } public PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store , ScheduledExecutorService executor ) { } private PassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , BackingCacheEntryFactory < K , V , E > entryFactory , ReplicationPassivationManager < K , E > passivationManager , BackingCacheEntryStore < K , V , E > store , ThreadFactory threadFactory , ScheduledExecutorService executor ) { } @ Override public boolean isClustered ( ) { } @ Override public Affinity getStrictAffinity ( ) { } @ Override public Affinity getWeakAffinity ( K key ) { } @ Override public boolean hasAffinity ( K key ) { } @ Override public E create ( ) { } @ Override public E get ( K key ) throws NoSuchEJBException { } @ Override public void passivate ( K key ) { } @ Override public E peek ( K key ) throws NoSuchEJBException { } @ Override public E release ( K key ) { } @ Override public void discard ( K key ) { } @ Override public void remove ( K key ) { } private void cancelExpirationPassivation ( K id ) { } private void cancel ( Map < K , Future < ? > > futures , K id ) { } private void scheduleExpirationPassivation ( K id ) { } private void schedule ( Map < K , Future < ? > > futures , K id , PassivatingBackingCacheImpl . TaskFactory < K > factory , long time , TimeUnit unit ) { } @ Override public void start ( ) { notifyLifecycleListeners ( STARTING ) ; try { store . start ( ) ; if ( ( this . threadFactory ) != null ) { <START_BUG> this . executor = Executors . newScheduledThreadPool ( 1 , this . threadFactory ) ; <END_BUG> } notifyLifecycleListeners ( STARTED ) ; } catch ( RuntimeException e ) { notifyLifecycleListeners ( FAILED ) ; throw e ; } } @ Override public void stop ( ) { } @ Override public GroupCompatibilityChecker getCompatibilityChecker ( ) { } interface TaskFactory < K > { Runnable createTask ( K id ) { } } private PassivatingBackingCacheImpl . TaskFactory < K > removeTaskFactory = new PassivatingBackingCacheImpl . TaskFactory < K > ( ) { @ Override public Runnable createTask ( K id ) { } } ; private PassivatingBackingCacheImpl . TaskFactory < K > passivateTaskFactory = new PassivatingBackingCacheImpl . TaskFactory < K > ( ) { @ Override public Runnable createTask ( K id ) { } } ; private void trace ( String pattern , Object ... args ) { } }

Fix:
this . executor = Executors . newSingleThreadScheduledExecutor ( this . threadFactory ) ;