### Question:
FsEntryHBaseCommon { public static byte typeVal(Object o) { if (o instanceof Long || o instanceof Integer) { return LONG; } else if (o instanceof String) { return STRING; } else if (o instanceof Date) { return DATE; } else if (o instanceof Map || o instanceof List) { return JSON; } else if (o instanceof byte[]) { return BYTE_ARRAY; } else if (o instanceof BufferProxy) { return BUFFER_STREAM; } else if (o instanceof FileProxy) { return FILE_STREAM; } else { return -1; } }  static byte typeVal(Object o); static byte[] createColSpec(Object o, String colName); static byte[] createColSpec(byte type, String colName); static String colName(byte[] colSpec); @SuppressWarnings("fallthrough") static Object unmarshall(byte[] colSpec, byte[] colVal); static void populate(Map<byte[], byte[]> input, Map<String,Object> out, Map<String, StreamProxy> streams); static final byte LONG; static final byte STRING; static final byte DATE; static final byte JSON; static final byte BYTE_ARRAY; static final byte BUFFER_STREAM; static final byte FILE_STREAM; }### Answer:
@Test public void testLongAsLong() { assertEquals(LONG, typeVal(Long.valueOf(7L))); }
@Test public void testLongAsInteger() { assertEquals(LONG, typeVal(Integer.valueOf(7))); }
@Test public void testString() { assertEquals(STRING, typeVal("string")); }
@Test public void testDate() { assertEquals(DATE, typeVal(new Date())); }
@Test public void testJsonMap() { assertEquals(JSON, typeVal(new HashMap<String,Object>())); }
@Test public void testJsonList() { assertEquals(JSON, typeVal(new ArrayList<Object>())); }
@Test public void testByteArray() { assertEquals(BYTE_ARRAY, typeVal(new byte[] {0x01, 0x02, 0x03})); }
@Test public void testStream() { assertEquals(BUFFER_STREAM, typeVal(new BufferProxy(new byte[] {0x01, 0x02, 0x03, 0x04}))); }
@Test public void testFileStream() { assertEquals(FILE_STREAM, typeVal(new FileProxy("a/bogus/path.txt"))); }