Lines Matching refs:Class
40 public class ImmutableClassToInstanceMapTest extends TestCase {
43 suite.addTestSuite(ImmutableClassToInstanceMapTest.class);
51 public Map<Class, Number> create(Object... elements) {
55 Entry<Class, Number> entry = (Entry<Class, Number>) object;
74 Map<Class<?>, Object> in = Collections.emptyMap();
82 Map<Class<? extends Number>, Number> in = Maps.newHashMap();
83 in.put(Number.class, 0);
84 in.put(Double.class, Math.PI);
88 Number zero = map.getInstance(Number.class);
91 Double pi = map.getInstance(Double.class);
98 Map<Class<? extends Number>, Number> nullKey = Collections.singletonMap(
106 Map<? extends Class<? extends Number>, Number> nullValue
107 = Collections.singletonMap(Number.class, null);
116 Map<Class<?>, Object> in = Collections.emptyMap();
122 ImmutableMap<Class<? extends Number>, ? extends Number> in
123 = ImmutableMap.of(Number.class, 0, Double.class, Math.PI);
127 Number zero = map.getInstance(Number.class);
130 Double pi = map.getInstance(Double.class);
137 .put(Integer.class, 0)
138 .put(int.class, 1)
142 assertEquals(0, (int) ictim.getInstance(Integer.class));
143 assertEquals(1, (int) ictim.getInstance(int.class));
146 abstract static class TestClassToInstanceMapGenerator
147 implements TestMapGenerator<Class, Number> {
150 public Class[] createKeyArray(int length) {
151 return new Class[length];
160 public SampleElements<Entry<Class, Number>> samples() {
161 Entry<Class, Number> entry1 =
162 Maps.immutableEntry((Class) Integer.class, (Number) 0);
163 Entry<Class, Number> entry2 =
164 Maps.immutableEntry((Class) Number.class, (Number) 1);
165 Entry<Class, Number> entry3 =
166 Maps.immutableEntry((Class) Double.class, (Number) 2.0);
167 Entry<Class, Number> entry4 =
168 Maps.immutableEntry((Class) Byte.class, (Number) (byte) 0x03);
169 Entry<Class, Number> entry5 =
170 Maps.immutableEntry((Class) Long.class, (Number) 0x0FF1C1AL);
171 return new SampleElements<Entry<Class, Number>>(
178 public Entry<Class, Number>[] createArray(int length) {
183 public Iterable<Entry<Class, Number>> order(
184 List<Entry<Class, Number>> insertionOrder) {