### Question:
SplitterFactory { public Optional<Splitter> getSplitter(final String columnName, final ResultSet resultSet, final int maxSplits) throws SQLException { int type = resultSet.getMetaData().getColumnType(1); switch (type) { case Types.INTEGER: return Optional.of(new IntegerSplitter(new SplitInfo<>(new SplitRange<>(resultSet.getInt(1), resultSet.getInt(2)), columnName, type, maxSplits))); default: return Optional.empty(); } }  Optional<Splitter> getSplitter(final String columnName, final ResultSet resultSet, final int maxSplits);  }### Answer:
@Test public void getIntegerSplitter() throws SQLException { Mockito.when(resultSet.getMetaData().getColumnType(1)).thenReturn(Types.INTEGER); Optional<Splitter> splitter = splitterFactory.getSplitter(TEST_COLUMN_NAME, resultSet, MAX_SPLITS); Assert.assertTrue(splitter.isPresent()); Assert.assertEquals(IntegerSplitter.class, splitter.get().getClass()); }
@Test public void getStringSplitter() throws SQLException { Mockito.when(resultSet.getMetaData().getColumnType(1)).thenReturn(Types.VARCHAR); Assert.assertFalse(splitterFactory.getSplitter(TEST_COLUMN_NAME, resultSet, MAX_SPLITS).isPresent()); }
@Test public void getFloatSplitter() throws SQLException { Mockito.when(resultSet.getMetaData().getColumnType(1)).thenReturn(Types.FLOAT); Assert.assertFalse(splitterFactory.getSplitter(TEST_COLUMN_NAME, resultSet, MAX_SPLITS).isPresent()); }
@Test public void getDoubleSplitter() throws SQLException { Mockito.when(resultSet.getMetaData().getColumnType(1)).thenReturn(Types.DOUBLE); Assert.assertFalse(splitterFactory.getSplitter(TEST_COLUMN_NAME, resultSet, MAX_SPLITS).isPresent()); }
@Test public void getDateSplitter() throws SQLException { Mockito.when(resultSet.getMetaData().getColumnType(1)).thenReturn(Types.DATE); Assert.assertFalse(splitterFactory.getSplitter(TEST_COLUMN_NAME, resultSet, MAX_SPLITS).isPresent()); }
@Test public void getDecimalSplitter() throws SQLException { Mockito.when(resultSet.getMetaData().getColumnType(1)).thenReturn(Types.DECIMAL); Assert.assertFalse(splitterFactory.getSplitter(TEST_COLUMN_NAME, resultSet, MAX_SPLITS).isPresent()); }