### Question:
HistoryUtil { public static <T> List<T> selectHistorySet( @Nullable final List<T> history, final int start, final int limit ) { if ((history == null) || (start >= history.size()) || (limit < 1)) { return Collections.emptyList(); } final int s = Math.max(start, 0); final int l = Math.min(limit, history.size() - s); return history.subList(s, s + l); }  static List<T> selectHistorySet(
            @Nullable final List<T> history,
            final int start,
            final int limit
    ); static List<Revision> selectRevisionHistorySetFrom(
            @Nullable final List<Revision> history,
            final String from,
            final int start,
            final int limit
    );  }### Answer:
@Test public void testSelectHistorySet() { final List<Integer> result = selectHistorySet(DUMMY_HISTORY, 0, 1); assertEquals(Lists.newArrayList(1), result); }
@Test public void testSelectHistorySetWithNegativeStart() { final List<Integer> result = selectHistorySet(DUMMY_HISTORY, -1, 1); assertEquals(Lists.newArrayList(1), result); }
@Test public void testSelectHistorySetWithNonPositiveLimit() { final List<Integer> result = selectHistorySet(DUMMY_HISTORY, 2, -1); assertEquals(Collections.<Integer>emptyList(), result); }
@Test public void testSelectHistorySetNotOverflow() { List<Integer> result = selectHistorySet(DUMMY_HISTORY, 0, Integer.MAX_VALUE); assertEquals(DUMMY_HISTORY, result); result = selectHistorySet(DUMMY_HISTORY, 0, Integer.MIN_VALUE); assertEquals(Collections.<Integer>emptyList(), result); result = selectHistorySet(DUMMY_HISTORY, Integer.MIN_VALUE, Integer.MAX_VALUE); assertEquals(DUMMY_HISTORY, result); }