Here you can find the source of getValueString(long value, TimeUnit unit)
private static String getValueString(long value, TimeUnit unit)
//package com.java2s; //License from project: Apache License import java.util.concurrent.TimeUnit; public class Main { private static String getValueString(long value, TimeUnit unit) { String result = value + " " + unit.toString().toLowerCase(); if (value == 1) { result = result.substring(0, result.length() - 1); }//w ww .j av a2 s. c om return result; } }