### Question:
CategoricalValueEncodings implements Serializable { public Map<String,Integer> getValueEncodingMap(int index) { return doGetMap(index); } CategoricalValueEncodings(Map<Integer,? extends Collection<String>> distinctValues); Map<String,Integer> getValueEncodingMap(int index); Map<Integer,String> getEncodingValueMap(int index); int getValueCount(int index); Map<Integer,Integer> getCategoryCounts(); @Override String toString();  }### Answer:
@Test public void testEncoding() { CategoricalValueEncodings encodings = makeTestValues(); Map<String,Integer> valueEncoding = encodings.getValueEncodingMap(0); assertEquals(0, valueEncoding.get("foo").intValue()); assertEquals(1, valueEncoding.get("bar").intValue()); assertEquals(2, valueEncoding.get("baz").intValue()); }