Test for Account class
This commit is contained in:
@ -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){
|
||||
|
Reference in New Issue
Block a user