Utils { protected static Object normalizeValue(Object value) { Class<?> klass = value.getClass(); if (klass == Double.class || klass == Integer.class) { return ((Number) value).floatValue(); } else { return value; } }  @SuppressWarnings("unchecked") static Object constructRefs(Bridge bridge, Map<String, Object> theMap); static boolean isRemoteObject(Class<?> klass); static Class<?> autobox(Class<?> klass); static Object defaultValueForPrimitive(Class<?> primitive); static final String DEFAULT_REDIRECTOR; static final BridgeEventHandler DEFAULT_EVENT_HANDLER; static final boolean DEFAULT_RECONNECT; static final String DEFAULT_SECURE_REDIRECTOR; static int logLevel; }
@Test public void testNormalizeObject() { String s = "FOO"; assertEquals(s, Utils.normalizeValue(s)); List<String> list = Arrays.asList("a", "b", "c", "d"); assertEquals(list, Utils.normalizeValue(list)); Map<String, Object> map = new HashMap<String, Object>(); map.put("a", 1); map.put("c", "FOO"); assertEquals(map, Utils.normalizeValue(map)); assertEquals(1.0f, Utils.normalizeValue(1)); assertEquals(1.0f, Utils.normalizeValue(1.0f)); assertEquals(1.0f, Utils.normalizeValue(1.0)); }