### Question:
State implements Serializable { public @NotNull String getEntityId(NliEntity e) { return entityToEntityId.getExisting(e); } State(Domain domain, NliRootEntity constantRootEntity, boolean deterministic); NliRootEntity getRootEntity(); void updateStateFollowingEntityGraphModifications(); boolean entityGraphsEqual(@Nullable State otherState); State deepCopy(); Domain getDomain(); @NotNull String getEntityId(NliEntity e); List<String> getEntityIds(List<? extends NliEntity> l); NliEntity getEntityById(String id); GraphKb getGraphKb(); @Override String toString();  }### Answer:
@Test public void testMethodCallInvocation() throws Exception { User user1; User user2; user1 = new User(); user2 = new User(); State state1 = new State(SimpleSocialNetwork.domain, createSimpleSocialNetwork(user1, user2), true); assertExpectedEqualityOfTwoStates(state1,state1, true); MethodId methodId = new MethodId(User.class, "addFriend", User.class); Argument arg = new NonPrimitiveArgument(state1.getEntityId(user2)); MethodCall methodCall = new MethodCall(methodId, state1.getEntityId(user1), arg); State state2 = methodCall.invokeOnDeepCopyOfState(state1); State state2_copy = methodCall.invokeOnDeepCopyOfState(state1); assertExpectedEqualityOfTwoStates(state2,state2_copy, true); assertExpectedEqualityOfTwoStates(state1,state2, false); methodId = new MethodId(User.class, "setAge", int.class); arg = new PrimitiveArgument(user1.age+1); methodCall = new MethodCall(methodId, state1.getEntityId(user1),arg); State state3 = methodCall.invokeOnDeepCopyOfState(state1); State state3_copy = methodCall.invokeOnDeepCopyOfState(state1); assertExpectedEqualityOfTwoStates(state3,state3_copy, true); assertExpectedEqualityOfTwoStates(state1,state3, false); }