@Test public void testGetBatchCount() { assertEquals(0, BatchUtil.getBatchCount(0,0)); assertEquals(0, BatchUtil.getBatchCount(-1,0)); assertEquals(0, BatchUtil.getBatchCount(-2,4)); assertEquals(0, BatchUtil.getBatchCount(5,-7)); assertEquals(1, BatchUtil.getBatchCount(9,9)); assertEquals(1, BatchUtil.getBatchCount(9,10)); assertEquals(1, BatchUtil.getBatchCount(9,11)); assertEquals(1, BatchUtil.getBatchCount(9,18)); assertEquals(1, BatchUtil.getBatchCount(9,19)); assertEquals(2, BatchUtil.getBatchCount(9,8)); assertEquals(2, BatchUtil.getBatchCount(9,7)); assertEquals(2, BatchUtil.getBatchCount(9,6)); assertEquals(2, BatchUtil.getBatchCount(9,5)); assertEquals(3, BatchUtil.getBatchCount(9,4)); assertEquals(3, BatchUtil.getBatchCount(9,3)); assertEquals(5, BatchUtil.getBatchCount(9,2)); assertEquals(9, BatchUtil.getBatchCount(9,1)); }
public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); }
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); } }
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); }  }
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); }  static boolean shouldRetain(int i, int maxRetention, int length); static int getBatchCount(int length, int batchSize); static List<Range<E>> getRanges(Collection<E> collection,
      int batchSize); }
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); }  static boolean shouldRetain(int i, int maxRetention, int length); static int getBatchCount(int length, int batchSize); static List<Range<E>> getRanges(Collection<E> collection,
      int batchSize);  }