ShadowValueJudgeUtil { public static boolean isShadowValue(final Object value) { return (value instanceof Boolean && (Boolean) value) || (value instanceof Integer && 1 == (Integer) value) || (value instanceof String && Boolean.parseBoolean((String) value)); }  static boolean isShadowValue(final Object value);  }
@Test public void assertShadowValueWhenBooleanAndTrue() { assertTrue(ShadowValueJudgeUtil.isShadowValue(Boolean.TRUE)); assertTrue(ShadowValueJudgeUtil.isShadowValue(true)); }
@Test public void assertShadowValueWhenBooleanAndFalse() { assertFalse(ShadowValueJudgeUtil.isShadowValue(Boolean.FALSE)); assertFalse(ShadowValueJudgeUtil.isShadowValue(false)); }
@Test public void assertShadowValueWhenIntegerAndOne() { assertTrue(ShadowValueJudgeUtil.isShadowValue(1)); }
@Test public void assertShadowValueWhenIntegerAndOther() { assertFalse(ShadowValueJudgeUtil.isShadowValue(-1)); assertFalse(ShadowValueJudgeUtil.isShadowValue(0)); assertFalse(ShadowValueJudgeUtil.isShadowValue(2)); }
@Test public void assertShadowValueWhenStringAndTrue() { assertTrue(ShadowValueJudgeUtil.isShadowValue("true")); assertTrue(ShadowValueJudgeUtil.isShadowValue("True")); assertTrue(ShadowValueJudgeUtil.isShadowValue("TRUE")); }
@Test public void assertShadowValueWhenStringAndFalse() { assertFalse(ShadowValueJudgeUtil.isShadowValue("false")); assertFalse(ShadowValueJudgeUtil.isShadowValue("False")); assertFalse(ShadowValueJudgeUtil.isShadowValue("FALSE")); }
@Test public void assertShadowValueWhenStringAndOther() { assertFalse(ShadowValueJudgeUtil.isShadowValue("tru")); assertFalse(ShadowValueJudgeUtil.isShadowValue("rue")); assertFalse(ShadowValueJudgeUtil.isShadowValue("als")); assertFalse(ShadowValueJudgeUtil.isShadowValue("other")); }
@Test public void assertShadowValueWhenOtherObj() { assertFalse(ShadowValueJudgeUtil.isShadowValue(new Object())); }