Test for Account class

This commit is contained in:
2018-12-08 15:00:35 +01:00
parent 8dbe6cfe6d
commit 571b8be7ee
9 changed files with 221 additions and 28 deletions

View File

@ -37,16 +37,17 @@ import java.util.HashSet;
*/
public class Scollection<KEY, OBJ> {
HashSet<OBJ> byObj = new HashSet<>();
// HashSet<OBJ> byObj = new HashSet<>();
HashMap<KEY, OBJ> byKey = new HashMap<>();
public void add(KEY key, OBJ obj) {
byObj.add(obj);
// byObj.add(obj);
byKey.put(key, obj);
}
public Collection<OBJ> getCollection(){
return Collections.unmodifiableCollection(byObj);
return Collections.unmodifiableCollection(byKey.values());
}
public OBJ get(KEY key){