### Question:
ConversionProcessorFactory { public static Optional<ConversionProcessor> getConversionProcessor(final Class<?> clazz) { Optional<ConversionProcessor> conversionProcessor = empty(); if (isByte(clazz)) { conversionProcessor = of(new ByteConversionProcessor()); } else if (isShort(clazz)) { conversionProcessor = of(new ShortConversionProcessor()); } else if (isInt(clazz)) { conversionProcessor = of(new IntegerConversionProcessor()); } else if (isLong(clazz)) { conversionProcessor = of(new LongConversionProcessor()); } else if (isFloat(clazz)) { conversionProcessor = of(new FloatConversionProcessor()); } else if (isDouble(clazz)) { conversionProcessor = of(new DoubleConversionProcessor()); } else if (isChar(clazz)) { conversionProcessor = of(new CharacterConversionProcessor()); } else if (isString(clazz)) { conversionProcessor = of(new StringConversionProcessor()); } else if (isBoolean(clazz)) { conversionProcessor = of(new BooleanConversionProcessor()); } else if (isBigInteger(clazz)) { conversionProcessor = of(new BigIntegerConversionProcessor()); } else if (isBigDecimal(clazz)) { conversionProcessor = of(new BigDecimalConversionProcessor()); } else if (isByteArray(clazz)) { conversionProcessor = of(new ByteArrayConversionProcessor()); } return conversionProcessor; }  static Optional<ConversionProcessor> getConversionProcessor(final Class<?> clazz);  }### Answer:
@Test public void testGetConversionProcessorReturnsNullInCaseNoProcessorExistsForTheGivenType() { Optional<ConversionProcessor> actual = underTest.getConversionProcessor(Pair.class); assertThat(actual).isEmpty(); }
@Test(dataProvider = "dataGetConversionProcessorTesting") public void testGetConversionProcessorWorksAsExpected(final String testCaseDescription, final Class<?> targetClass, final Class<ConversionProcessor> expectedResult) { Optional<ConversionProcessor> actual = underTest.getConversionProcessor(targetClass); assertThat(actual).containsInstanceOf(expectedResult); }