### Question:
CommonRange extends FuzzyLinguisticVariable implements TemplateRangeItem { public static <T extends Comparable<? super T>> int findPositionFor(final T item, final SortedSet<T> values) { final SortedSet<T> head = values.headSet(item); return head.size(); } CommonRange(final Relationship join, final boolean isSafeMode);  CommonRange(final CommonRange other); protected  CommonRange(final boolean isSafeMode); static boolean haveCommonColumn(final Set<TableColumn> a, final Set<TableColumn> b); static int findPositionFor(final T item, final SortedSet<T> values); static Set<Type> getUniqueColumnTypes(final Set<TableColumn> columnSet); static String buildUniqueRangeNameForTable(final TableStats table); static boolean isRangeCompatible(final Type a, final Type b); boolean isSuitableFor(final Relationship join); void addJoin(final Relationship join); @Override Set<Type> getUniqueColumnTypes(); @Override boolean hasCommonColumn(final Set<TableColumn> columns); Set<TableStats> getTables(); Set<TableColumn> getColumns(); void flattenJoins(); boolean hasIntersectionWith(final CommonRange other); boolean isSubrangeOf(final CommonRange other); void mergeInto(final CommonRange other); void remove(final TableStats table); int getSize(); @Override String getFclName(); @Override String getTemplateItemName(); void evaluate(final Set<Long> uniqueJoinFrequencies, final SortedSet<Long> sortedJoinCardinalities, final boolean isRowWidthWeightingEnabled); @Override double getScore(); @Override String toString(); @Override boolean contains(final TableStats table); @Override Set<TableColumn> getRangeColumnsFor(final TableStats table);  }### Answer:
@Test public void testFindPositionFor() { final SortedSet<Integer> values = new TreeSet<Integer>(Arrays.asList(-4, -3, 0, 2, 5, 13, 14, 15, 16, 17, 18, 20)); assertEquals(0, CommonRange.findPositionFor(-6, values)); assertEquals(0, CommonRange.findPositionFor(-5, values)); assertEquals(0, CommonRange.findPositionFor(-4, values)); assertEquals(1, CommonRange.findPositionFor(-3, values)); assertEquals(2, CommonRange.findPositionFor(-2, values)); assertEquals(2, CommonRange.findPositionFor(0, values)); assertEquals(4, CommonRange.findPositionFor(4, values)); assertEquals(5, CommonRange.findPositionFor(12, values)); assertEquals(5, CommonRange.findPositionFor(13, values)); assertEquals(6, CommonRange.findPositionFor(14, values)); assertEquals(10, CommonRange.findPositionFor(18, values)); assertEquals(11, CommonRange.findPositionFor(19, values)); assertEquals(11, CommonRange.findPositionFor(20, values)); assertEquals(12, CommonRange.findPositionFor(21, values)); }