@Override
    public void assign(Object o) {
        if (o == null) {
            predicate = null;
        } else if (o instanceof Predicate) {
            predicate = (Predicate)o;
        } else if (o instanceof PredicateFieldValue) {
            predicate = ((PredicateFieldValue)o).predicate;
        } else {
            throw new IllegalArgumentException("Expected " + getClass().getName() + ", got " +
                                               o.getClass().getName() + ".");
        }
    }
@Test
    public void requireThatBadAssignThrows() {
        try {
            new PredicateFieldValue().assign(new Object());
            fail();
        } catch (IllegalArgumentException e) {
            assertEquals("Expected com.yahoo.document.datatypes.PredicateFieldValue, got java.lang.Object.",
                         e.getMessage());
        }
    }