Set<String> once = new HashSet<>();
Set<String> duplicates = new HashSet<>();
list.stream().forEach(s -> {
if (!duplicates.contains(s)) {
if (once.contains(s)) {
once.remove(s);
duplicates.add(s);
} else {
once.add(s);
}
}
});
рандомно но равномерно
return new MyModel() {{
myField = view.myField;
}};
MyModel myModel = new MyModel();
myModel.myField = view.myField;
return myModel;
public static class Integer implements MyRandom <java.lang.Integer> {
private Random rand = new Random();
public java.lang.Integer GetRandom() {
return rand.nextInt(10);
}
}
private RegistrationDataDistributor distributor = new RegistrationDataDistributor(); // 18 line