PreferencesFile extends OwnedEntity { public String getData() { return data; } PreferencesFile();  PreferencesFile(String name, String data);  PreferencesFile(String userId, String name, String data);  PreferencesFile(PreferencesFile clone); String getData(); void setData(String data); @Override String toString();  }
@Test public void constructorNameData() { PreferencesFile another = new PreferencesFile(NAME, DATA); assertEquals("name not same.", NAME, another.getName()); assertNull(another.getUserId()); assertEquals("data not same.", DATA, another.getData()); }
@Test public void constructorUserIdNameData() { PreferencesFile another = new PreferencesFile(USER_ID, NAME, DATA); assertEquals("name not same.", NAME, another.getName()); assertEquals("userId not same.", USER_ID, another.getUserId()); assertEquals("data not same.", DATA, another.getData()); }
@Test public void copyConstructor() { PreferencesFile another = new PreferencesFile(entity); assertEquals("name not same.", entity.getName(), another.getName()); assertEquals("UserId not same.", entity.getUserId(), another .getUserId()); assertEquals("data not same.", entity.getData(), another.getData()); }