TradingUtils { public static final boolean isEmpty(Collection<?> collection) { return collection == null || collection.isEmpty(); } private  TradingUtils(); static final String executingRequestMsg(HttpRequest request); static long toUnixTime(DateTime dateTime); static long toMillisFromNanos(long nanos); static String[] splitCcyPair(String instrument, String currencySeparator); static double calculateTakeProfitPrice(double tickSize, TradingSignal signal, double bidPrice,
			double askPrice, int pipsDesired); static final String responseToString(HttpResponse response); static final boolean isEmpty(Collection<?> collection); static final boolean isEmpty(Map<?, ?> map); static String[] splitInstrumentPair(String instrument); static final int getSign(String currencyInstrument, TradingSignal side, String currency); static void closeSilently(CloseableHttpClient httpClient); static void printErrorMsg(HttpResponse response); static String getResponse(HttpResponse response); static final int CCY_PAIR_LEN; static final int CCY_SEP_CHR_POS; }
@Test public void isEmptyTest() { List<String> nameColl = Lists.newArrayList("foo", "bar"); assertFalse(TradingUtils.isEmpty(nameColl)); nameColl.clear(); assertTrue(TradingUtils.isEmpty(nameColl)); nameColl = null; assertTrue(TradingUtils.isEmpty(nameColl)); Map<Integer, String> idNameMap = Maps.newHashMap(); idNameMap.put(1, "foobar"); assertFalse(TradingUtils.isEmpty(idNameMap)); idNameMap.remove(1); assertTrue(TradingUtils.isEmpty(idNameMap)); idNameMap = null; assertTrue(TradingUtils.isEmpty(idNameMap)); }