@Test public void testChangeName() throws Exception { Font theFont = Font.DEFAULT_FONT; Font theMutated = theFont.changeName(Font.FontName.VERDANA); assertNotSame(theFont, theMutated); assertEquals(Font.FontName.VERDANA, theMutated.name); assertEquals(theFont.size, theMutated.size); }
public Font changeName(FontName aName) { return new Font(aName, size); }
Font implements Distributable { public Font changeName(FontName aName) { return new Font(aName, size); } }
Font implements Distributable { public Font changeName(FontName aName) { return new Font(aName, size); } Font(FontName aFontName, int aSize); }
Font implements Distributable { public Font changeName(FontName aName) { return new Font(aName, size); } Font(FontName aFontName, int aSize); @Override boolean equals(Object o); @Override int hashCode(); Font changeSize(int aSize); Font changeName(FontName aName); @Override Map<String, Object> serialize(); static Font deserialize(Map<String, Object> aSerializedData); }
Font implements Distributable { public Font changeName(FontName aName) { return new Font(aName, size); } Font(FontName aFontName, int aSize); @Override boolean equals(Object o); @Override int hashCode(); Font changeSize(int aSize); Font changeName(FontName aName); @Override Map<String, Object> serialize(); static Font deserialize(Map<String, Object> aSerializedData); static final Font DEFAULT_FONT; final FontName name; final int size; }