### Question:
ObjectIdQuery extends IndirectQuery { public ObjectId getObjectId() { return objectId; } @SuppressWarnings("unused") private  ObjectIdQuery();  ObjectIdQuery(ObjectId objectID);  ObjectIdQuery(ObjectId objectId, boolean fetchingDataRows, int cachePolicy); @Override QueryMetadata getMetaData(final EntityResolver resolver); ObjectId getObjectId(); int getCachePolicy(); boolean isFetchMandatory(); boolean isFetchAllowed(); boolean isFetchingDataRows(); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); static final int CACHE; static final int CACHE_REFRESH; static final int CACHE_NOREFRESH; }### Answer:
@Test public void testConstructorObjectId() { ObjectId oid = ObjectId.of("MockDataObject", "a", "b"); ObjectIdQuery query = new ObjectIdQuery(oid); assertSame(oid, query.getObjectId()); }
@Test public void testSerializability() throws Exception { ObjectId oid = ObjectId.of("test", "a", "b"); ObjectIdQuery query = new ObjectIdQuery(oid); Object o = Util.cloneViaSerialization(query); assertNotNull(o); assertTrue(o instanceof ObjectIdQuery); assertEquals(oid, ((ObjectIdQuery) o).getObjectId()); }