001/*
002 * Copyright (C) 2012 The Guava Authors
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.google.common.collect.testing;
018
019import com.google.common.annotations.GwtCompatible;
020import java.util.Map.Entry;
021import java.util.SortedMap;
022import org.jspecify.annotations.NullMarked;
023import org.jspecify.annotations.Nullable;
024
025/**
026 * Creates sorted maps, containing sample elements, to be tested.
027 *
028 * @author Louis Wasserman
029 */
030@GwtCompatible
031@NullMarked
032public interface TestSortedMapGenerator<K extends @Nullable Object, V extends @Nullable Object>
033    extends TestMapGenerator<K, V> {
034  @Override
035  SortedMap<K, V> create(Object... elements);
036
037  /**
038   * Returns an entry with a key less than the keys of the {@link #samples()} and less than the key
039   * of {@link #belowSamplesGreater()}.
040   */
041  Entry<K, V> belowSamplesLesser();
042
043  /**
044   * Returns an entry with a key less than the keys of the {@link #samples()} but greater than the
045   * key of {@link #belowSamplesLesser()}.
046   */
047  Entry<K, V> belowSamplesGreater();
048
049  /**
050   * Returns an entry with a key greater than the keys of the {@link #samples()} but less than the
051   * key of {@link #aboveSamplesGreater()}.
052   */
053  Entry<K, V> aboveSamplesLesser();
054
055  /**
056   * Returns an entry with a key greater than the keys of the {@link #samples()} and greater than
057   * the key of {@link #aboveSamplesLesser()}.
058   */
059  Entry<K, V> aboveSamplesGreater();
060}