### Question:
BigIntegerType implements Type, Serializable { @Override public Object cast(Object obj) { BigInteger value = null; if (obj != null) { if (obj instanceof BigInteger) { value = (BigInteger) obj; } else if (obj instanceof Number) { value = new BigInteger(Long.toString(((Number) obj).longValue())); } else if (obj instanceof Boolean) { value = new BigInteger(((Boolean) obj) ? "1" : "0"); } else if (obj instanceof String) { try { value = new BigInteger((String) obj); } catch (NumberFormatException e) { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, obj.toString()); } } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, obj.toString()); } } return value; } private  BigIntegerType(); @Override String getName(); @Override boolean supportsEq(); @Override boolean supportsOrdering(); @Override JsonNode toJson(JsonNodeFactory factory, Object obj); @Override Object fromJson(JsonNode node); @Override Object cast(Object obj); @SuppressWarnings({"unchecked", "rawtypes"}) @Override int compare(Object v1, Object v2); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static final Type TYPE; static final String NAME; }### Answer:
@Test public void testCastNull() { assertNull(bigIntegerType.cast(null)); }
@Test public void testCastBigInteger() { assertTrue(bigIntegerType.cast(BigInteger.ONE) instanceof BigInteger); }
@Test public void testCastLong() { assertTrue(bigIntegerType.cast(Long.MAX_VALUE) instanceof BigInteger); }
@Test public void testCastBooleanTrue() { assertTrue(bigIntegerType.cast(Boolean.TRUE) instanceof BigInteger); }
@Test public void testCastBooleanFalse() { assertTrue(bigIntegerType.cast(Boolean.FALSE) instanceof BigInteger); }
@Test public void testCastGoodString() { assertTrue(bigIntegerType.cast(String.valueOf(BigInteger.TEN)) instanceof BigInteger); }
@Test(expected = Error.class) public void testCastBadString() { bigIntegerType.cast("string"); }
@Test(expected = Error.class) public void testCastOther() { Object object = new Object(); bigIntegerType.cast(object); }