### Question:
RecordkeyAdapter { public Writable convertKeyValue(Object key) { if (converter == null) { converter = initializeConverter(key); LOG.debug("converter initialized for type " + key.getClass() + " (key value: " + key + ")"); } return converter.get(key); } RecordkeyAdapter(); int appendRecordkeyField(List<OneField> recFields, RequestContext input,
                                    OneRow onerow); Writable convertKeyValue(Object key);  }### Answer:
@Test public void convertKeyValueBadSecondValue() { boolean key = true; initRecordkeyAdapter(); runConvertKeyValue(key, new BooleanWritable(key)); String badKey = "bad"; try { recordkeyAdapter.convertKeyValue(badKey); fail("conversion of string to boolean should fail"); } catch (ClassCastException e) { assertEquals(e.getMessage(), "java.lang.String cannot be cast to java.lang.Boolean"); } }