### Question:
TradeLimits { @VisibleForTesting long getFirstMonthRiskBasedTradeLimit(long maxLimit, long riskFactor) { long smallestLimit = maxLimit / (4 * riskFactor); double decimalForm = MathUtils.scaleDownByPowerOf10((double) smallestLimit, 8); double rounded = MathUtils.roundDouble(decimalForm, 4); return MathUtils.roundDoubleToLong(MathUtils.scaleUpByPowerOf10(rounded, 8)); } @Inject  TradeLimits(DaoStateService daoStateService, PeriodService periodService); void onAllServicesInitialized(); Coin getMaxTradeLimit(); long getRoundedRiskBasedTradeLimit(long maxLimit, long riskFactor);  }### Answer:
@Test public void testGetFirstMonthRiskBasedTradeLimit() { TradeLimits tradeLimits = new TradeLimits(mock(DaoStateService.class), mock(PeriodService.class)); long expected, result; expected = 0; result = tradeLimits.getFirstMonthRiskBasedTradeLimit(0, 1); assertEquals(expected, result); expected = 25000000; result = tradeLimits.getFirstMonthRiskBasedTradeLimit(100000000, 1); assertEquals(expected, result); expected = 3130000; result = tradeLimits.getFirstMonthRiskBasedTradeLimit(100000000, 8); assertEquals(expected, result); expected = 6250000; result = tradeLimits.getFirstMonthRiskBasedTradeLimit(200000000, 8); assertEquals(expected, result); }