@Test void shouldFindNoMatchInEmptyTarget() { final int length = lengthOfTrailingPartialSubList( asList("a", "b", "c"), emptyList()); assertThat(length, is(equalTo(0))); }
static int lengthOfTrailingPartialSubList(final List<?> source, final List<?> target) { final int s = source.size() - 1; final int t = target.size() - 1; int l = 0; while (l <= s && l <= t && source.get(s - l).equals(target.get(t - l))) { l++; } return l; }
Lists { static int lengthOfTrailingPartialSubList(final List<?> source, final List<?> target) { final int s = source.size() - 1; final int t = target.size() - 1; int l = 0; while (l <= s && l <= t && source.get(s - l).equals(target.get(t - l))) { l++; } return l; } }
Lists { static int lengthOfTrailingPartialSubList(final List<?> source, final List<?> target) { final int s = source.size() - 1; final int t = target.size() - 1; int l = 0; while (l <= s && l <= t && source.get(s - l).equals(target.get(t - l))) { l++; } return l; } private  Lists(); }
Lists { static int lengthOfTrailingPartialSubList(final List<?> source, final List<?> target) { final int s = source.size() - 1; final int t = target.size() - 1; int l = 0; while (l <= s && l <= t && source.get(s - l).equals(target.get(t - l))) { l++; } return l; } private  Lists();  }
Lists { static int lengthOfTrailingPartialSubList(final List<?> source, final List<?> target) { final int s = source.size() - 1; final int t = target.size() - 1; int l = 0; while (l <= s && l <= t && source.get(s - l).equals(target.get(t - l))) { l++; } return l; } private  Lists();   }