### Question:
IntPartition extends BasePartition implements JdbcFragmentMetadata { @Override public String toSqlConstraint(String quoteString, DbProduct dbProduct) { if (quoteString == null) { throw new RuntimeException("Quote string cannot be null"); } return generateRangeConstraint( quoteString + column + quoteString, Stream.of(boundaries).map(b -> b == null ? null : b.toString()).toArray(String[]::new) ); } IntPartition(String column, Long start, Long end); @Override String toSqlConstraint(String quoteString, DbProduct dbProduct); Long[] getBoundaries();  }### Answer:
@Test public void testNormal() { IntPartition partition = new IntPartition(COL_RAW, 0L, 1L); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals(COL + " >= 0 AND " + COL + " < 1", constraint); }
@Test public void testRightBounded() { IntPartition partition = new IntPartition(COL_RAW, null, 0L); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals(COL + " < 0", constraint); }
@Test public void testLeftBounded() { IntPartition partition = new IntPartition(COL_RAW, 0L, null); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals(COL + " >= 0", constraint); }
@Test public void testRightBoundedInclusive() { IntPartition partition = new IntPartition(COL_RAW, null, 0L); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals(COL + " < 0", constraint); }
@Test public void testLeftBoundedInclusive() { IntPartition partition = new IntPartition(COL_RAW, 0L, null); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals(COL + " >= 0", constraint); }
@Test public void testEqualBoundaries() { IntPartition partition = new IntPartition(COL_RAW, 0L, 0L); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals(COL + " = 0", constraint); }
@Test public void testInvalidNullQuoteString() { IntPartition partition = new IntPartition(COL_RAW, 0L, 1L); thrown.expect(RuntimeException.class); partition.toSqlConstraint(null, dbProduct); }