ConverterFactory { public static BigDecimalConverter createBigDecimalConverter(boolean currency, boolean percentage, boolean useGrouping, int precision, String currencySymbol) { String msg = messageService.getMessage(CANNOT_CONVERT, VaadinUtils.getLocale()); if (currency) { return new CurrencyBigDecimalConverter(msg, precision, useGrouping, currencySymbol); } else if (percentage) { return new PercentageBigDecimalConverter(msg, precision, useGrouping); } else { return new BigDecimalConverter(msg, precision, useGrouping); } } private  ConverterFactory(); static BigDecimalConverter createBigDecimalConverter(boolean currency, boolean percentage,
			boolean useGrouping, int precision, String currencySymbol); @SuppressWarnings("unchecked") static Converter<String, T> createConverterFor(Class<T> clazz, AttributeModel attributeModel,
			boolean grouping); static StringToIntegerConverter createIntegerConverter(boolean useGrouping, boolean percentage); static StringToLongConverter createLongConverter(boolean useGrouping, boolean percentage); static StringToDoubleConverter createDoubleConverter(boolean currency, boolean percentage,
			boolean useGrouping, int precision, String currencySymbol); static ZonedDateTimeToLocalDateTimeConverter createZonedDateTimeConverter(ZoneId zoneId);  }
@Test public void testCreateBigDecimalConverter() { BigDecimalConverter cv = ConverterFactory.createBigDecimalConverter(false, false, false, 2, null); assertFalse(cv instanceof PercentageBigDecimalConverter); }
@Test public void testCreateBigDecimalConverter2() { BigDecimalConverter cv = ConverterFactory.createBigDecimalConverter(false, true, false, 2, null); assertTrue(cv instanceof PercentageBigDecimalConverter); }
@Test public void testCreateBigDecimalConverter3() { BigDecimalConverter cv = ConverterFactory.createBigDecimalConverter(true, false, false, 2, "EUR"); assertTrue(cv instanceof CurrencyBigDecimalConverter); }