Uses of Annotation Interface
com.google.common.annotations.VisibleForTesting
Packages that use VisibleForTesting
Package
Description
Basic utility libraries and interfaces.
Discouraged (in favor of Caffeine) caching utilities.
Collection interfaces and implementations, and other utilities for collections.
Interfaces, utilities, and simple implementations of escapers and encoders.
Discouraged in favor of dependency injection and
concurrency frameworks, EventBus allows publish-subscribe-style communication.
Hash functions and related structures.
Utility methods and classes for I/O; for example input streams, output streams, readers, writers,
and files.
Arithmetic functions operating on primitive values and on
BigInteger
and BigDecimal
instances.Static utilities for the eight primitive types and
void
, and value types for treating
them as unsigned or storing them in immutable arrays.Utilities for reflection.
Testing utilities.
Concurrency utilities.
-
Uses of VisibleForTesting in com.google.common.base
Classes in com.google.common.base with annotations of type VisibleForTestingModifier and TypeClassDescription(package private) static final class
Implementation ofCharMatcher.whitespace()
.(package private) static class
(package private) static class
(package private) static class
Fields in com.google.common.base with annotations of type VisibleForTestingModifier and TypeFieldDescription(package private) static boolean
FinalizableReferenceQueue.SystemLoader.disabled
(package private) static final String
Throwables.SHARED_SECRETS_CLASSNAME
SharedSecrets class name to load using reflectionMethods in com.google.common.base with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) static int
SmallCharMatcher.chooseTableSize
(int setSize) Returns an array size suitable for the backing array of a hash table that uses open addressing with linear probing in its implementation.(package private) static boolean
Strings.validSurrogatePairAt
(CharSequence string, int index) True when a valid surrogate pair starts at the givenindex
in the givenstring
. -
Uses of VisibleForTesting in com.google.common.cache
Fields in com.google.common.cache with annotations of type VisibleForTestingModifier and TypeFieldDescription(package private) long
CacheBuilderSpec.accessExpirationDuration
(package private) TimeUnit
CacheBuilderSpec.accessExpirationTimeUnit
(package private) Integer
CacheBuilderSpec.concurrencyLevel
(package private) Integer
CacheBuilderSpec.initialCapacity
(package private) LocalCache.Strength
CacheBuilderSpec.keyStrength
(package private) Long
CacheBuilderSpec.maximumSize
(package private) Long
CacheBuilderSpec.maximumWeight
(package private) Boolean
CacheBuilderSpec.recordStats
(package private) long
CacheBuilderSpec.refreshDuration
(package private) TimeUnit
CacheBuilderSpec.refreshTimeUnit
(package private) LocalCache.Strength
CacheBuilderSpec.valueStrength
(package private) long
CacheBuilderSpec.writeExpirationDuration
(package private) TimeUnit
CacheBuilderSpec.writeExpirationTimeUnit
Methods in com.google.common.cache with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) boolean
LocalCache.Segment.containsValue
(Object value) This method is a convenience for testing.(package private) ReferenceEntry<K,
V> LocalCache.copyEntry
(ReferenceEntry<K, V> original, ReferenceEntry<K, V> newNext) This method is a convenience for testing.(package private) boolean
LocalCache.isLive
(ReferenceEntry<K, V> entry, long now) This method is a convenience for testing.(package private) ReferenceEntry<K,
V> LocalCache.newEntry
(K key, int hash, ReferenceEntry<K, V> next) This method is a convenience for testing.(package private) LocalCache.ValueReference<K,
V> LocalCache.newValueReference
(ReferenceEntry<K, V> entry, V value, int weight) This method is a convenience for testing.(package private) boolean
LocalCache.Segment.removeEntry
(ReferenceEntry<K, V> entry, int hash, RemovalCause cause) -
Uses of VisibleForTesting in com.google.common.collect
Classes in com.google.common.collect with annotations of type VisibleForTestingModifier and TypeClassDescription(package private) static final class
(package private) static final class
LinkedHashMultimap entries are in no less than three coexisting linked lists: a bucket in the hash table for aSet<V>
associated with a key, the linked list of insertion-ordered entries in thatSet<V>
, and the linked list of entries in the LinkedHashMultimap as a whole.(package private) final class
(package private) static class
(package private) static class
Exception thrown by aOrdering.explicit(List)
orOrdering.explicit(Object, Object[])
comparator when comparing a value outside the set of values it can compare.(package private) static class
(package private) static final class
(package private) static final class
(package private) static final class
TreeRangeSet.RangesByUpperBound<C extends Comparable<?>>
Fields in com.google.common.collect with annotations of type VisibleForTestingModifier and TypeFieldDescription(package private) final Object[]
RegularImmutableList.array
(package private) Object[]
ImmutableList.Builder.contents
(package private) Object[]
CompactHashSet.elements
The elements contained in the set, in the range of [0, size()).(package private) final RegularImmutableSortedSet<E>
RegularImmutableSortedMultiset.elementSet
(package private) int[]
CompactHashMap.entries
Contains the logical entries, in the range of [0, size()).RegularImmutableBiMap.entries
RegularImmutableMap.entries
(package private) int
ArrayListMultimap.expectedValuesPerKey
(package private) int
HashMultimap.expectedValuesPerKey
(package private) static final double
CompactHashMap.HASH_FLOODING_FPP
Maximum allowed false positive probability of detecting a hash flooding attack given random input.(package private) static final double
CompactHashSet.HASH_FLOODING_FPP
Maximum allowed false positive probability of detecting a hash flooding attack given random input.(package private) static final double
RegularImmutableMap.HASH_FLOODING_FPP
Maximum allowed false positive probability of detecting a hash flooding attack given random input.(package private) static final double
RegularImmutableMultiset.HASH_FLOODING_FPP
Maximum allowed false positive probability of detecting a hash flooding attack given random input.(package private) LinkedHashMultimap.ValueEntry<K,
V>[] LinkedHashMultimap.ValueSet.hashTable
(package private) Object[]
CompactHashMap.keys
The keys of the entries in the map, in the range of [0, size()).(package private) long[]
CompactLinkedHashMap.links
Contains the link pointers corresponding with the entries, in the range of [0, size()).(package private) final MapMakerInternalMap<E,
MapMaker.Dummy, ?, ?> Interners.InternerImpl.map
(package private) static final int
RegularImmutableMap.MAX_HASH_BUCKET_LENGTH
Maximum allowed length of a hash table bucket before falling back to a j.u.HashMap based implementation.(package private) static final int
RegularImmutableMultiset.MAX_HASH_BUCKET_LENGTH
Maximum allowed length of a hash table bucket before falling back to a j.u.HashMap based implementation.(package private) static final double
RegularImmutableMap.MAX_LOAD_FACTOR
Closed addressing tends to perform well even with high load factors.(package private) static final double
RegularImmutableMultiset.MAX_LOAD_FACTOR
Closed addressing tends to perform well even with high load factors.(package private) final int
MinMaxPriorityQueue.maximumSize
(package private) final int
EvictingQueue.maxSize
(package private) final NavigableMap<Cut<C>,
Range<C>> TreeRangeSet.rangesByLowerBound
(package private) final Object[]
RegularImmutableSet.table
(package private) static final double
LinkedHashMultimap.VALUE_SET_LOAD_FACTOR
(package private) Object[]
CompactHashMap.values
The values of the entries in the map, in the range of [0, size()).(package private) int
LinkedHashMultimap.valueSetCapacity
Methods in com.google.common.collect with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) ImmutableBiMap<K,
V> ImmutableBiMap.Builder.buildJdkBacked()
(package private) ImmutableMap<K,
V> ImmutableMap.Builder.buildJdkBacked()
(package private) ImmutableMultiset<E>
ImmutableMultiset.Builder.buildJdkBacked()
(package private) int
MinMaxPriorityQueue.capacity()
(package private) static int
Lists.computeArrayListCapacity
(int arraySize) (package private) boolean
MapMakerInternalMap.Segment.containsValue
(Object value) This method is a convenience for testing.CompactHashMap.convertToHashFloodingResistantImplementation()
CompactHashSet.convertToHashFloodingResistantImplementation()
(package private) E
This method is a convenience for testing.(package private) static <K,
V> ImmutableBiMap<K, V> CompactHashMap.delegateOrNull()
CompactHashSet.delegateOrNull()
(package private) void
ImmutableSet.Builder.forceJdk()
(package private) static int
MinMaxPriorityQueue.initialQueueSize
(int configuredExpectedSize, int maximumSize, Iterable<?> initialContents) (package private) static boolean
MinMaxPriorityQueue.isEvenLevel
(int index) (package private) boolean
MinMaxPriorityQueue.isIntact()
Returnstrue
if the MinMax heap structure holds.(package private) boolean
MapMakerInternalMap.isLiveForTesting
(MapMakerInternalMap.InternalEntry<K, V, ?> entry) This method is a convenience for testing.(package private) boolean
CompactHashSet.isUsingHashFloodingResistance()
(package private) MapMakerInternalMap.Strength
MapMakerInternalMap.keyStrength()
(package private) static <K,
V> Map<K, V> (package private) boolean
CompactHashMap.needsAllocArrays()
Returns whether arrays need to be allocated.(package private) boolean
CompactHashSet.needsAllocArrays()
Returns whether arrays need to be allocated.(package private) MinMaxPriorityQueue.MoveDesc<E>
MinMaxPriorityQueue.removeAt
(int index) Removes the element at positionindex
.(package private) static <E> Set<E>
(package private) Equivalence<Object>
MapMakerInternalMap.valueEquivalence()
(package private) MapMakerInternalMap.Strength
MapMakerInternalMap.valueStrength()
Constructors in com.google.common.collect with annotations of type VisibleForTestingModifierConstructorDescription(package private)
ConcurrentHashMultiset
(ConcurrentMap<E, AtomicInteger> countMap) -
Uses of VisibleForTesting in com.google.common.escape
Methods in com.google.common.escape with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) static char[][]
ArrayBasedEscaperMap.createReplacementArray
(Map<Character, String> map) -
Uses of VisibleForTesting in com.google.common.eventbus
Classes in com.google.common.eventbus with annotations of type VisibleForTestingModifier and TypeClassDescription(package private) static final class
Subscriber that synchronizes invocations of a method to ensure that only one thread may enter the method at a time.Fields in com.google.common.eventbus with annotations of type VisibleForTestingModifier and TypeFieldDescription(package private) final Object
Subscriber.target
The object with the subscriber method.Methods in com.google.common.eventbus with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) static ImmutableSet<Class<?>>
SubscriberRegistry.flattenHierarchy
(Class<?> concreteClass) Flattens a class's type hierarchy into a set ofClass
objects including all superclasses (transitively) and all interfaces implemented by these superclasses.(package private) Set<Subscriber>
SubscriberRegistry.getSubscribersForTesting
(Class<?> eventType) (package private) void
Subscriber.invokeSubscriberMethod
(Object event) Invokes the subscriber method. -
Uses of VisibleForTesting in com.google.common.hash
Methods in com.google.common.hash with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) long
BloomFilter.bitSize()
Returns the number of bits in the underlying bit array.(package private) static <T> BloomFilter<T>
BloomFilter.create
(Funnel<? super T> funnel, long expectedInsertions, double fpp, BloomFilter.Strategy strategy) (package private) static long
FarmHashFingerprint64.fingerprint
(byte[] bytes, int offset, int length) (package private) static long
Fingerprint2011.fingerprint
(byte[] bytes, int offset, int length) (package private) static long
Fingerprint2011.hash128to64
(long high, long low) Implementation of Hash128to64 from util/hash/hash128to64.h(package private) static long
Fingerprint2011.murmurHash64WithSeed
(byte[] bytes, int offset, int length, long seed) (package private) static long
BloomFilter.optimalNumOfBits
(long n, double p) Computes m (total bits of Bloom filter) which is expected to achieve, for the specified expected insertions, the required false positive probability.(package private) static int
BloomFilter.optimalNumOfHashFunctions
(long n, long m) Computes the optimal k (number of hashes per element inserted in Bloom filter), given the expected insertions and total number of bits in the Bloom filter. -
Uses of VisibleForTesting in com.google.common.io
Classes in com.google.common.io with annotations of type VisibleForTestingModifier and TypeClassDescription(package private) static final class
Suppresses exceptions by logging them.(package private) static final class
Suppresses exceptions by adding them to the exception that will be thrown using JDK7's addSuppressed(Throwable) mechanism.(package private) static interface
Suppression strategy interface.Fields in com.google.common.io with annotations of type VisibleForTestingModifier and TypeFieldDescription(package private) static final Logger
Closeables.logger
(package private) final Closer.Suppressor
Closer.suppressor
Methods in com.google.common.io with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) File
FileBackedOutputStream.getFile()
Returns the file holding the data (possibly null).(package private) static void
TempFileCreator.testMakingUserPermissionsFromScratch()
Creates the permissions normally used for Windows filesystems, looking up the user afresh, even if previous calls have initialized thePermissionSupplier
fields.Constructors in com.google.common.io with annotations of type VisibleForTesting -
Uses of VisibleForTesting in com.google.common.math
Fields in com.google.common.math with annotations of type VisibleForTestingModifier and TypeFieldDescription(package private) static int[]
IntMath.biggestBinomials
(package private) static final int[]
LongMath.biggestSimpleBinomials
(package private) static final double[]
DoubleMath.everySixteenthFactorial
(package private) static final int
IntMath.FLOOR_SQRT_MAX_INT
(package private) static final long
LongMath.FLOOR_SQRT_MAX_LONG
(package private) static final int[]
IntMath.halfPowersOf10
(package private) static final long[]
LongMath.halfPowersOf10
(package private) static final int
DoubleMath.MAX_FACTORIAL
(package private) static final int
IntMath.MAX_POWER_OF_SQRT2_UNSIGNED
The biggest half power of two that can fit in an unsigned int.(package private) static final long
LongMath.MAX_POWER_OF_SQRT2_UNSIGNED
The biggest half power of two that fits into an unsigned long(package private) static final int
IntMath.MAX_SIGNED_POWER_OF_TWO
(package private) static final long
LongMath.MAX_SIGNED_POWER_OF_TWO
(package private) static final byte[]
IntMath.maxLog10ForLeadingZeros
(package private) static final byte[]
LongMath.maxLog10ForLeadingZeros
(package private) static final long
DoubleUtils.ONE_BITS
(package private) static final int[]
IntMath.powersOf10
(package private) static final long[]
LongMath.powersOf10
(package private) static final int
BigIntegerMath.SQRT2_PRECOMPUTE_THRESHOLD
(package private) static final BigInteger
BigIntegerMath.SQRT2_PRECOMPUTED_BITS
Methods in com.google.common.math with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) static int
IntMath.lessThanBranchFree
(int x, int y) Returns 1 ifx < y
as unsigned integers, and 0 otherwise.(package private) static int
LongMath.lessThanBranchFree
(long x, long y) Returns 1 ifx < y
as unsigned longs, and 0 otherwise. -
Uses of VisibleForTesting in com.google.common.primitives
Classes in com.google.common.primitives with annotations of type VisibleForTestingModifier and TypeClassDescription(package private) static class
Provides a lexicographical comparator implementation; either a Java implementation or a faster implementation based onUnsafe
.(package private) static enum
Methods in com.google.common.primitives with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) static Comparator<byte[]>
UnsignedBytes.lexicographicalComparatorJavaImpl()
-
Uses of VisibleForTesting in com.google.common.reflect
Methods in com.google.common.reflect with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) static String
ClassPath.getClassName
(String filename) (package private) static ImmutableMap<File,
ClassLoader> ClassPath.getClassPathEntries
(ClassLoader classloader) (package private) static URL
ClassPath.getClassPathEntry
(File jarFile, String path) Returns the absolute uri of the Class-Path entry value as specified in JAR File Specification.(package private) static ImmutableSet<File>
ClassPath.getClassPathFromManifest
(File jarFile, Manifest manifest) Returns the class path URIs specified by theClass-Path
manifest attribute, according to JAR File Specification.(package private) static ImmutableList<URL>
ClassPath.parseJavaClassPath()
Returns the URLs in the class path specified by thejava.class.path
system property.(package private) static WildcardType
Returns a newWildcardType
withupperBound
.(package private) static WildcardType
Types.supertypeOf
(Type lowerBound) Returns a newWildcardType
withlowerBound
.(package private) static File
(package private) static <T> TypeToken<? extends T>
TypeToken.toGenericType
(Class<T> cls) Returns the type token representing the generic type declaration ofcls
. -
Uses of VisibleForTesting in com.google.common.testing
Classes in com.google.common.testing with annotations of type VisibleForTestingModifier and TypeClassDescription(package private) static class
Thrown if the test tries to invoke a static factory method to test instance methods but the factory returned null.(package private) static class
Thrown if the test fails to generate two distinct non-null values of a constructor or factory parameter in order to testObject.equals(java.lang.Object)
andObject.hashCode()
of the declaring class.(package private) static class
Thrown if the test tries to invoke a constructor or static factory method but failed because the dummy value of a constructor or method parameter is unknown.Methods in com.google.common.testing with annotations of type VisibleForTestingModifier and TypeMethodDescriptionAbstractPackageSanityTests.findClassesToTest
(Iterable<? extends Class<?>> classes, Iterable<String> explicitTestNames) Finds the classes not ending with a test suffix and not covered by an explicit test whose name isexplicitTestNames
. -
Uses of VisibleForTesting in com.google.common.util.concurrent
Classes in com.google.common.util.concurrent with annotations of type VisibleForTestingModifier and TypeInterfaceDescription(package private) static interface
(package private) static class
Provides a check of whether an exception type is valid for use withFuturesGetChecked.getChecked(Future, Class)
, possibly using caching.(package private) static final class
Using this as the blocker object allows introspection and debugging tools to see that the currentRunner thread is blocked on the progress of the interruptor thread, which can help identify deadlocks.(package private) static class
Represents the current application to register shutdown hooks.(package private) static class
Implementation of Striped where up to 2^k stripes can be represented, using a ConcurrentMap where the key domain is [0..2^k).(package private) static class
Implementation of Striped where up to 2^k stripes can be represented, using an AtomicReferenceArray of size 2^k.(package private) static final class
Methods in com.google.common.util.concurrent with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) void
MoreExecutors.Application.addShutdownHook
(Thread hook) (package private) static void
FuturesGetChecked.checkExceptionClassValidity
(Class<? extends Exception> exceptionClass) (package private) static FuturesGetChecked.GetCheckedTypeValidator
FuturesGetChecked.classValueValidator()
(package private) static RateLimiter
RateLimiter.create
(double permitsPerSecond, long warmupPeriod, TimeUnit unit, double coldFactor, RateLimiter.SleepingStopwatch stopwatch) (package private) static RateLimiter
RateLimiter.create
(double permitsPerSecond, RateLimiter.SleepingStopwatch stopwatch) (package private) static <E extends Enum<E>>
Map<E,CycleDetectingLockFactory.LockGraphNode> CycleDetectingLockFactory.createNodes
(Class<E> clazz) For a given Enum type, creates an immutable map from each of the Enum's values to a corresponding LockGraphNode, with theallowedPriorLocks
anddisallowedPriorLocks
prepopulated with nodes according to the natural ordering of the associated Enum values.(package private) static <V,
X extends Exception>
VFuturesGetChecked.getChecked
(FuturesGetChecked.GetCheckedTypeValidator validator, Future<V> future, Class<X> exceptionClass) Implementation ofFutures.getChecked(Future, Class)
.(package private) Thread
InterruptibleTask.Blocker.getOwner()
(package private) static boolean
FuturesGetChecked.isCheckedException
(Class<? extends Exception> type) (package private) static FuturesGetChecked.GetCheckedTypeValidator
FuturesGetChecked.weakSetValidator()
(package private) CountDownLatch
ClosingFuture.whenClosedCountDown()
Constructors in com.google.common.util.concurrent with annotations of type VisibleForTestingModifierConstructorDescription(package private)
WithExplicitOrdering
(CycleDetectingLockFactory.Policy policy, Map<E, CycleDetectingLockFactory.LockGraphNode> lockGraphNodes) -
Uses of VisibleForTesting in com.google.thirdparty.publicsuffix
Methods in com.google.thirdparty.publicsuffix with annotations of type VisibleForTestingModifier and TypeMethodDescription(package private) static ImmutableMap<String,
PublicSuffixType> TrieParser.parseFullString
(String encoded)