@Test public void testAddToAnimationSequence() throws Exception { Animation theAnimation = new Animation("Test"); Animation theNewAnimation = theAnimation.addToAnimationSequence(new ResourceName("Res")); assertEquals(1, theNewAnimation.getSequenceSize()); assertEquals(0, theAnimation.getSequenceSize()); assertNotSame(theAnimation, theNewAnimation); }
public Animation addToAnimationSequence(ResourceName aName) { List<ResourceName> theNewSequence = ArrayUtils.asList(animationSequence); theNewSequence.add(aName); return new Animation(uuid, name, theNewSequence.toArray(new ResourceName[theNewSequence.size()])); }
Animation implements Distributable { public Animation addToAnimationSequence(ResourceName aName) { List<ResourceName> theNewSequence = ArrayUtils.asList(animationSequence); theNewSequence.add(aName); return new Animation(uuid, name, theNewSequence.toArray(new ResourceName[theNewSequence.size()])); } }
Animation implements Distributable { public Animation addToAnimationSequence(ResourceName aName) { List<ResourceName> theNewSequence = ArrayUtils.asList(animationSequence); theNewSequence.add(aName); return new Animation(uuid, name, theNewSequence.toArray(new ResourceName[theNewSequence.size()])); } Animation(String aName); private  Animation(String aUUID, String aName, ResourceName[] aAnimationSequence); }
Animation implements Distributable { public Animation addToAnimationSequence(ResourceName aName) { List<ResourceName> theNewSequence = ArrayUtils.asList(animationSequence); theNewSequence.add(aName); return new Animation(uuid, name, theNewSequence.toArray(new ResourceName[theNewSequence.size()])); } Animation(String aName); private  Animation(String aUUID, String aName, ResourceName[] aAnimationSequence); String getName(); String getUuid(); Animation changeName(String aName); Animation addToAnimationSequence(ResourceName aName); Animation removeFromAnimationSequence(ResourceName aName); Animation removeFromAnimationSequence(int aIndex); int getSequenceSize(); ResourceName getResourceByIndex(int aIndex); ResourceName computeCurrentFrame(long aGameTime, Integer aSpeed); @Override Map<String, Object> serialize(); static Animation deserialize(Map<String, Object> aData); }
Animation implements Distributable { public Animation addToAnimationSequence(ResourceName aName) { List<ResourceName> theNewSequence = ArrayUtils.asList(animationSequence); theNewSequence.add(aName); return new Animation(uuid, name, theNewSequence.toArray(new ResourceName[theNewSequence.size()])); } Animation(String aName); private  Animation(String aUUID, String aName, ResourceName[] aAnimationSequence); String getName(); String getUuid(); Animation changeName(String aName); Animation addToAnimationSequence(ResourceName aName); Animation removeFromAnimationSequence(ResourceName aName); Animation removeFromAnimationSequence(int aIndex); int getSequenceSize(); ResourceName getResourceByIndex(int aIndex); ResourceName computeCurrentFrame(long aGameTime, Integer aSpeed); @Override Map<String, Object> serialize(); static Animation deserialize(Map<String, Object> aData);  }