### Question:
LogPruneStrategyFactory { @VisibleForTesting static Threshold getThresholdByType( FileSystemAbstraction fileSystem, Clock clock, ThresholdConfigValue value, String originalConfigValue ) { long thresholdValue = value.value; switch ( value.type ) { case "files": return new FileCountThreshold( thresholdValue ); case "size": return new FileSizeThreshold( fileSystem, thresholdValue ); case "txs": case "entries": return new EntryCountThreshold( thresholdValue ); case "hours": return new EntryTimespanThreshold( clock, HOURS, thresholdValue ); case "days": return new EntryTimespanThreshold( clock, DAYS, thresholdValue ); default: throw new IllegalArgumentException( "Invalid log pruning configuration value '" + originalConfigValue + "'. Invalid type '" + value.type + "', valid are files, size, txs, entries, hours, days." ); } } LogPruneStrategyFactory();   }### Answer:
@Test public void testLogPruneThresholdsByType() { FileSystemAbstraction fsa = Mockito.mock( FileSystemAbstraction.class ); Clock clock = Clocks.systemClock(); assertThat( getThresholdByType( fsa, clock, new ThresholdConfigValue( "files", 25 ), "" ), instanceOf( FileCountThreshold.class ) ); assertThat( getThresholdByType( fsa, clock, new ThresholdConfigValue( "size", 16000 ), "" ), instanceOf( FileSizeThreshold.class ) ); assertThat( getThresholdByType( fsa, clock, new ThresholdConfigValue( "txs", 4000 ), "" ), instanceOf( EntryCountThreshold.class ) ); assertThat( getThresholdByType( fsa, clock, new ThresholdConfigValue( "entries", 4000 ), "" ), instanceOf( EntryCountThreshold.class ) ); assertThat( getThresholdByType( fsa, clock, new ThresholdConfigValue( "hours", 100 ), "" ), instanceOf( EntryTimespanThreshold.class ) ); assertThat( getThresholdByType( fsa, clock, new ThresholdConfigValue( "days", 100_000 ), "" ), instanceOf( EntryTimespanThreshold.class) ); }