Entities { public void addEntities(String[][] entitySet) { for (int i = 0; i < entitySet.length; ++i) { addEntity(entitySet[i][0], Integer.parseInt(entitySet[i][1])); } } Entities();  Entities(Entities entities); void addEntities(String[][] entitySet); void addEntity(String name, int value); String getEntityName(int value); int getEntityValue(String name); static final Entities XML; static final Entities HTML32; static final Entities HTML40; static final Entities HTML40_MODIFIED; }
@Test public void addEntities() throws Exception { String[][] array = { { "foo", "100" }, { "bar", "101" } }; Entities e = new Entities(); e.addEntities(array); assertEquals("foo", e.getEntityName(100)); assertEquals("bar", e.getEntityName(101)); assertEquals(100, e.getEntityValue("foo")); assertEquals(101, e.getEntityValue("bar")); }