### Question:
ObjectManager implements LifecycleAspect { public ObjectFactBindingEntity saveObjectFactBinding(ObjectFactBindingEntity binding) { if (binding == null) return null; if (getObject(binding.getObjectID()) == null) throw new IllegalArgumentException(String.format("Object with id = %s does not exist.", binding.getObjectID())); if (objectDao.getObjectFactBinding(binding.getObjectID(), binding.getFactID()) != null) throw new ImmutableViolationException("It is not allowed to update an ObjectFactBinding."); objectDao.save(binding); return binding; } @Inject  ObjectManager(ClusterManager clusterManager); @Override void startComponent(); @Override void stopComponent(); ObjectTypeEntity getObjectType(UUID id); ObjectTypeEntity getObjectType(String name); List<ObjectTypeEntity> fetchObjectTypes(); ObjectTypeEntity saveObjectType(ObjectTypeEntity type); ObjectEntity getObject(UUID id); ObjectEntity getObject(String type, String value); Iterator<ObjectEntity> getObjects(List<UUID> id); ObjectEntity saveObject(ObjectEntity object); Iterator<ObjectFactBindingEntity> fetchObjectFactBindings(UUID id); ObjectFactBindingEntity saveObjectFactBinding(ObjectFactBindingEntity binding);  }### Answer:
@Test public void testSaveObjectFactBindingReturnsSameEntity() { ObjectFactBindingEntity binding = createObjectFactBinding(createAndSaveObject().getId()); assertSame(binding, getObjectManager().saveObjectFactBinding(binding)); }
@Test public void testSaveObjectFactBindingReturnsNullOnNullInput() { assertNull(getObjectManager().saveObjectFactBinding(null)); }
@Test(expected = IllegalArgumentException.class) public void testSaveObjectFactBindingWithNonExistingObjectThrowsException() { getObjectManager().saveObjectFactBinding(createObjectFactBinding(UUID.randomUUID())); }
@Test(expected = ImmutableViolationException.class) public void testSaveObjectFactBindingTwiceThrowsException() { ObjectFactBindingEntity binding = createObjectFactBinding(createAndSaveObject().getId()); getObjectManager().saveObjectFactBinding(binding); getObjectManager().saveObjectFactBinding(binding); }