MockValue (Object o, Class<?> type, final MockVirtualMachine virtualMachine) { if (type == boolean.class) { return new MockBooleanValue(virtualMachine, (Boolean)o); } if (type == int.class) { return new MockIntegerValue(virtualMachine, (Integer)o); } if (type == float.class) { return new MockFloatValue(virtualMachine, (Float)o); } if (type == double.class) { return new MockDoubleValue(virtualMachine, (Double)o); } return MockObjectReference.createObjectReference(o, type, virtualMachine); }