WritableName { public static synchronized void addName(Class<?> writableClass, String name) { NAME_TO_CLASS.put(name, writableClass); } private  WritableName(); static synchronized void setName(Class<?> writableClass, String name); static synchronized void addName(Class<?> writableClass, String name); static synchronized String getName(Class<?> writableClass); static synchronized Class<?> getClass(String name, Configuration conf
                                            );  }
@Test public void testAddName() throws Exception { Configuration conf = new Configuration(); String altName = testName + ".alt"; WritableName.setName(SimpleWritable.class, testName); WritableName.addName(SimpleWritable.class, altName); Class<?> test = WritableName.getClass(altName, conf); assertTrue(test.equals(SimpleWritable.class)); test = WritableName.getClass(testName, conf); assertTrue(test.equals(SimpleWritable.class)); }