### Question:
Files { public void addOrChangeFile(File file, ACS acs) throws SQLException { if (!acs.getUser().isUnittypeAdmin(unittype.getId())) { throw new IllegalArgumentException("Not allowed action for this user"); } file.setConnectionProperties(acs.getDataSource()); file.validate(); addOrChangeFileImpl(unittype, file, acs); nameMap.put(file.getName(), file); idMap.put(file.getId(), file); versionTypeMap.put(file.getVersion() + file.getType(), file); if (file.getOldName() != null) { nameMap.remove(file.getOldName()); file.setOldName(null); } } protected  Files(
      Map<Integer, File> idMap,
      Map<String, File> nameMap,
      Map<String, File> versionTypeMap,
      Unittype unittype); File getById(Integer id); File getByName(String name); File getByVersionType(String version, FileType type); @Override String toString(); File[] getFiles(); File[] getFiles(FileType type); void addOrChangeFile(File file, ACS acs); void deleteFile(File file, ACS acs);  }### Answer:
@Test public void addOrChangeFile() throws SQLException { String unittypeName = "Test unittype"; Unittype unittype = TestUtils.createUnittype(unittypeName, acs); String fileName = "File name"; byte[] bytes = "Hei, dette er en test".getBytes(); String version = "v1.0"; FileType fileType = FileType.MISC; TestUtils.createFileAndVerify(unittype, fileName, bytes, fileType, version, acs); File file = unittype.getFiles().getByName(fileName); assertNotNull(file); assertEquals(bytes, file.getContent()); }