
src.samples.java.ex.NMCS_Sample Maven / Gradle / Ivy
package ex;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
public class NMCS_Sample {
private static List test1 = new Vector();
static {
test1.add("one");
test1.add("two");
test1.add("three");
}
private static Map fp = new HashMap<>();
private Map test2 = new Hashtable();
private Set test3 = new HashSet();
private List test4 = new Vector();
public String test1() {
StringBuffer sb = new StringBuffer();
String comma = "";
for (String s : test1) {
sb.append(comma);
comma = ",";
sb.append(s);
}
return sb.toString();
}
public String test2(String s) {
test2 = new Hashtable();
return test2.get("foo");
}
public Set test3() {
Set temp = test3;
temp.add("Foo");
return temp;
}
public List test4(boolean b1, boolean b2) {
return b1 ? test4 : b2 ? new Vector() : test4;
}
public void fpComputeIfAbsent(String val) {
fp.computeIfAbsent(val, this::test2);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy