### Question:
ShipTypeDecoder { public static String getShipType(BigInteger ts) { if (ts == null) return null; else return getShipType(ts.intValue()); } private  ShipTypeDecoder(); static String getShipType(BigInteger ts); static String getShipType(Integer ts); static void main(String[] args);  }### Answer:
@Test public void testAll() { assertEquals("unknown code 0", getShipType(0)); assertEquals("unknown code 100", getShipType(100)); assertEquals("Reserved - All", getShipType(10)); assertEquals("Engaged in diving operations", getShipType(34)); assertEquals("Tug", getShipType(52)); assertEquals( "WIG - Carrying DG, HS, or MP, IMO Hazard or pollutant category A", getShipType(21)); }
@Test public void testNull() { assertNull(getShipType((Integer) null)); }
@Test public void testBigIntegerNull() { assertNull(getShipType((BigInteger) null)); }
@Test public void testBigIntegerNonNull() { assertEquals("unknown code 0", getShipType(BigInteger.valueOf(0))); }