Test1.javapackagecom.test;importjava.util.HashMap;publicclassTest1{publicstaticHashMaphm=newHashMap();publicsynchronizedstaticvoidadd(Stringuid,Test2t){hm.p...
Test1.java
package com.test;
import java.util.HashMap;
public class Test1 {
public static HashMap hm = new HashMap();
public synchronized static void add(String uid, Test2 t){
hm.put(uid, t);
}
public static Test2 get(String uid){
return (Test2)hm.get(uid);
}
}
Test2.java
package com.test;
public class Test2 {
public String str;
public String getStr() {
return str;
}
public void setStr(String str) {
this.str = str;
}
}
Test3.java
package com.test;
public class Test3 {
public static void ma