### Question:
StackFormatter { public static long stackSizeToQuantity(String string) throws ParseException { int multiplier = getMultiplier(string); float parsedValue = NUMBER_FORMATTER.parse(string).floatValue(); return (long) (parsedValue * multiplier); }  static String quantityToStackSize(long quantity); static String quantityToRSStackSize(int quantity); static String quantityToRSDecimalStack(int quantity); static long stackSizeToQuantity(String string); static String formatNumber(final long number); static String formatNumber(double number);  }### Answer:
@Test public void stackSizeToQuantity() throws ParseException { assertEquals(0, StackFormatter.stackSizeToQuantity("0")); assertEquals(907, StackFormatter.stackSizeToQuantity("907")); assertEquals(1200, StackFormatter.stackSizeToQuantity("1200")); assertEquals(10_500, StackFormatter.stackSizeToQuantity("10,500")); assertEquals(10_500, StackFormatter.stackSizeToQuantity("10.5K")); assertEquals(33_560_000, StackFormatter.stackSizeToQuantity("33.56M")); assertEquals(2_000_000_000, StackFormatter.stackSizeToQuantity("2B")); assertEquals(0, StackFormatter.stackSizeToQuantity("-0")); assertEquals(-400, StackFormatter.stackSizeToQuantity("-400")); assertEquals(-400_000, StackFormatter.stackSizeToQuantity("-400k")); assertEquals(-40_543_000, StackFormatter.stackSizeToQuantity("-40.543M")); try { StackFormatter.stackSizeToQuantity("0L"); fail("Should have thrown an exception for invalid suffix."); } catch (ParseException ignore) { } try { StackFormatter.stackSizeToQuantity("badstack"); fail("Should have thrown an exception for improperly formatted stack."); } catch (ParseException ignore) { } }