File { public final void setName(String name) { if (!isValid(name)) throw new IllegalArgumentException("File name cannot be null or empty"); this.name = name; } File(final String fileName, final int fileSize);  File(final File file); protected  File(final File file, final boolean masterCopy); static boolean isValid(final String fileName); static boolean isValid(final File file); File makeReplica(); File makeMasterCopy(); FileAttribute getAttribute(); int getAttributeSize(); String getName(); final void setName(String name); boolean setOwnerName(String name); String getOwnerName(); int getSize(); int getSizeInByte(); boolean setSize(int fileSize); boolean setUpdateTime(double time); double getLastUpdateTime(); boolean setRegistrationID(int id); long getRegistrationID(); boolean setType(int type); int getType(); boolean setChecksum(int checksum); int getChecksum(); boolean setCost(double cost); double getCost(); long getCreationTime(); boolean isRegistered(); boolean isMasterCopy(); void setMasterCopy(boolean masterCopy); boolean isDeleted(); void setDeleted(boolean deleted); boolean setTransactionTime(double time); double getTransactionTime(); @Override String toString(); Datacenter getDatacenter(); final File setDatacenter(Datacenter datacenter); static final int NOT_REGISTERED; static final int TYPE_UNKNOWN; }
@Test public void testSetName() { final String name = "a-randomly-chosen-file-name.txt"; final File instance = createFile(); instance.setName(name); assertEquals(name, instance.getName()); }