### Question:
TemporalIndexCache extends IndexPartsCache<TemporalIndexCache.Offset,T> { T uncheckedSelect( ValueGroup valueGroup ) { switch ( valueGroup ) { case DATE: return date(); case LOCAL_DATE_TIME: return localDateTime(); case ZONED_DATE_TIME: return zonedDateTime(); case LOCAL_TIME: return localTime(); case ZONED_TIME: return zonedTime(); case DURATION: return duration(); default: throw new IllegalStateException( "Unsupported value group " + valueGroup ); } } TemporalIndexCache( Factory<T> factory );   }### Answer:
@Test public void stressInstantiationWithClose() throws Throwable { StringFactory factory = new StringFactory(); TemporalIndexCache<String> cache = new TemporalIndexCache<>( factory ); Race race = new Race().withRandomStartDelays(); MutableInt instantiatedAtClose = new MutableInt(); race.addContestant( () -> { try { cache.uncheckedSelect( valueGroups[0] ); cache.uncheckedSelect( valueGroups[1] ); } catch ( IllegalStateException e ) { } }, 1 ); race.addContestant( () -> { cache.closeInstantiateCloseLock(); instantiatedAtClose.setValue( count( cache ) ); }, 1 ); race.go(); try { cache.uncheckedSelect( valueGroups[2] ); fail( "No instantiation after closed" ); } catch ( IllegalStateException e ) { } assertEquals( instantiatedAtClose.intValue(), count( cache ) ); }