BooleanValue implements CellValue { public static BooleanValue from(final Object o) throws FastOdsException { if (o instanceof Boolean) { return new BooleanValue((Boolean) o); } else if (o instanceof BooleanValue) { return (BooleanValue) o; } else { throw new FastOdsException("Can't cast " + o + " to Boolean"); } } BooleanValue(final Boolean value); static BooleanValue from(final Object o); @Override void setToCell(final TableCell tableCell); @Override boolean equals(final Object o); @Override final int hashCode();  }
@Test public final void testFromBoolean() throws FastOdsException { Assert.assertEquals(new BooleanValue(true), BooleanValue.from(true)); Assert.assertNotEquals(new BooleanValue(true), BooleanValue.from(false)); Assert.assertEquals(new BooleanValue(false), BooleanValue.from(false)); Assert.assertNotEquals(new BooleanValue(false), BooleanValue.from(true)); }
@Test public final void testFromBooleanValue() throws FastOdsException { final BooleanValue bv1 = new BooleanValue(true); final BooleanValue bv2 = BooleanValue.from(bv1); Assert.assertEquals(bv1, bv2); }
@Test(expected = FastOdsException.class) public final void testFromBooleanObject() throws FastOdsException { BooleanValue.from(new Object()); }