@Test public void testIncrementBy() { Speed theSpeed = new Speed(20); Speed theOtherSpeed = theSpeed.incrementBy(10); assertEquals(30L, theOtherSpeed.get(), 0); assertNotSame(theSpeed, theOtherSpeed); }
@ReflectiveMethod public Speed incrementBy(int aAmount) { return new Speed(speed + aAmount); }
Speed implements Reflectable, Distributable { @ReflectiveMethod public Speed incrementBy(int aAmount) { return new Speed(speed + aAmount); } }
Speed implements Reflectable, Distributable { @ReflectiveMethod public Speed incrementBy(int aAmount) { return new Speed(speed + aAmount); } Speed(long aSpeed); }
Speed implements Reflectable, Distributable { @ReflectiveMethod public Speed incrementBy(int aAmount) { return new Speed(speed + aAmount); } Speed(long aSpeed); Long get(); @ReflectiveMethod Speed incrementBy(int aAmount); @ReflectiveMethod Speed resetToZero(); @Override SpeedClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Speed deserialize(Map<String, Object> aSerializedData); }
Speed implements Reflectable, Distributable { @ReflectiveMethod public Speed incrementBy(int aAmount) { return new Speed(speed + aAmount); } Speed(long aSpeed); Long get(); @ReflectiveMethod Speed incrementBy(int aAmount); @ReflectiveMethod Speed resetToZero(); @Override SpeedClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Speed deserialize(Map<String, Object> aSerializedData); final long speed; }