Here you can find the source of getDurationUnit(Map
private static TimeUnit getDurationUnit(Map<String, Object> config)
//package com.java2s; import java.util.Map; import java.util.concurrent.TimeUnit; public class Main { private static TimeUnit getDurationUnit(Map<String, Object> config) { String durationUnit = (String) config.getOrDefault("durationUnit", TimeUnit.SECONDS.name()); return TimeUnit.valueOf(durationUnit.toUpperCase()); }// w w w . j a v a 2s .co m }