Friday

String literal && String pool


/*  String object created with using new() operator.
    This always create a new object in heap memory.
    At the below, object and object2 have different references.
*/
String object = new String("Eda"); 
String object2 = new String("Eda"); 
System.out.println(object == object2); // false

/* String object created with using String literal syntax.
   If an object exists in string pool then returns it. Otherwise, creates a new string object and puts into string pool.
   At the below, literal and literal2 have the same reference.
*/
String literal = "Eda";
String literal2 = "Eda";
System.out.println(literal == literal2); // true

NOTE: While comparing two string, we can't know which string parameter has created with new() or literal. So use always equals().

Strings which has created with literal syntax, is cached. This cache is known as "String pool".

If an object exists in string pool then returns it. Otherwise, creates a new string object and puts into string pool. This is called as "interning".
     Interning can be manually, as follows.
          -manually intern in Java 6 is not a good practice. Just because pool has a fixed memory.

String literal = "Eda";
String object = new String("Eda"); 
String internedObject = object.intern();
System.out.println(literal == internedObject); // true

Just before java 7, that cache was in PermGen space. With java 7, it is in heap space.
     permgen space >> has fixed size && can not expanded at runtime, you had to change JVM option(-XX:MaxPermSize=1G) && risk of getting OutOfMemory error.
     heap space >> unreferenced strings has removed from pool && it is garbage collected which means strings with no references  will gone.

There is more JVM options for pool sizing: (your pool size should be high enough)
-XX:StringTableSize=4901 //The default pool size is: 1009 to the Java7u40, after that 60013, alsa java 8 is the same. 
-XX:+PrintStringTableStatistics //print string pool usage statistics when the program finish execution

Wednesday

Some advices on using Optional

//DON'T
Optional<User> user = null;
//DO
Optional<User> user =  Optional.empty();

//Don't confuse Optional.of() and Optional.ofNullable(). Choose the right one.

//DON'T
return Optional.ofNullable("EDA");
//DO
return Optional.of("EDA"); //no risk for NPE of using of() method so choose this.

//DON'T
String parameterToMethod = ...; // can be null
return Optional.of(parameterToMethod);//can throw NPE if parameter is null
//DO
String parameterToMethod = ...; // can be null
return Optional.ofNullable(parameterToMethod);//no risk for NPE

//DON'T
String userName = ... ;
return Optional.ofNullable(userName).orElse("EDA");
//DO
String userName = ... ;
return userName == null ? "EDA" : userName; // choose always the simplest one for such easy cases

//DON'T
Optional<String> user = ...; //can be empty
String myUser = user.get(); // can throw NoSuchElementException if user is empty
//DO
Optional<String> user = ...; //can be empty
if(user.isPresent()) {
 String myUser = user.get();
}


//DON'T
Optional<String> userName = ...;
if(userName.isPresent()) {
   return userName.get();
} else {
   return "Unknown person";
}
//DO
Optional<String> userName = ...;
return userName.orElse("Unknown person");

// DON'T
Optional<String> parameterUserName = ... ;
Optional<String> userName = Optional.of("EDA");
if(parameterUserName.isPresent()) {
 return parameterUserName;
} else {
 return userName;
}
//DO
Optional<String> parameterUserName = ... ;
Optional<String> userName = Optional.of("EDA");
return parameterUserName.or(() -> userName); // with java 9

// DON'T
Optional<String> userName = ... ;
if(userName.isPresent()) {
    System.out.println("userName: " + userName.get());
} else {
    System.out.println("User not found");
}
//DO - java 9
Optional<String> userName = ... ;
userName.ifPresentOrElse(
    System::out::println, 
    () -> System.out.println("User not found")
};

//DON'T
Optional<String> userName = ...;
if (userName.isPresent()) {
    System.out.println("userName: " + userName.get());
}
//DO
Optional<String> userName = ...;
userName.ifPresent(System.out::println);

//DON'T
Optional<String> userName = ...;
if(userName.isPresent()) {
 return userName.get();
} else {
 throw new NoSuchElementException(); 
}
//DO
Optional<String> userName = ...;
return userName.orElseThrow(); //java 10
return userName.orElseThrow(YourException::new);//java 8-9 

//DON'T
 .......
 .filter(Optional::isPresent)
        .map(Optional::get)
 .collect(toList());
//DO
 .......
 .flatMap(Optional::stream)
 .collect(toList());

// AVOID
Optional<Integer> opt = Optional.of(10);
Optional<Long> opt = Optional.of(20L);
Optional<Double> opt = Optional.of(20.53d);

// PREFER
OptionalInt opt = OptionalInt.of(10);           // opt.getAsInt()
OptionalLong opt = OptionalLong.of(20L);        // opt.getAsLong()
OptionalDouble opt = OptionalDouble.of(20.53d); // opt.getAsDouble()

Monday

Optional in java 8 & 9

I'll try to give example for Optional class which has came up for NullPointerException. It is a wrapper class, it can contain any other Object or it can be empty. Java 8 features:

Create Optional instances:
//You can create an empty Optional instance.
Optional.empty();
 
//of() method will throw NullPointerException if the user is null
//you should use of() method only if you are sure that your object is not null
Optional<User> opt = Optional.of(user);

//ofNullable() method can be use if the user object is null or not null.
Optional<User> opt = Optional.ofNullable(user);

Retrieve the actual object inside Optional instance:
//you can use get() method but if the user object is null then it will throw NoSuchElementException.
Optional<User> opt = Optional.ofNullable(user);
User myUser = opt.get();

//so, you should first check the value is present or not
//isPresent() method can be use
Optional<User> opt = Optional.ofNullable(user);
if(opt.isPresent()) {
 User myUser = opt.get();
 //your other jobs
}

//There is also ifPresent() method which combines isPresent() and get()
//lambda expression is used
Optional<User> opt = Optional.ofNullable(user);
opt.ifPresent(myUser -> {
    ///your other jobs
})

Return values:
//orElse() method returns the values if it's present, if not present then returns the other argument
//if user is not null then returns it. Otherwise returns user2.
User myUser = Optional.ofNullable(user).orElse(user2);


//orElseGet() method returns the values if it's present,
//if not present then executes Supplier interface
User myUser = Optional.ofNullable(user).orElseGet( () -> user2);

Lets see the difference between orElse() and orElseGet().
In the following example object is null and both return the other object. There is no difference as you see but....
User user = null; 
System.out.log("orElse>> ");
User myUser = Optional.ofNullable(user).orElse(createUser());
System.out.log(myUser.getName());
System.out.log("orElseGet>> ");
User myUser = Optional.ofNullable(user).orElseGet( () -> createUser());
System.out.log(myUser.getName());

...
private User createUser() {
    logger.debug("createUser method inside");
    return new User("eda2");
}

/*
 Output:
  orElse>>
  createUser method inside
  eda2
  orElseGet>>
  createUser method inside
  eda2
*/

In the following example object is not null.
But even if object is not null orElse() method has gone createUser() method.
orElse() always will call the given function() but orElseGet() will call only if optional is not present.
So orElse() is very expensive for the resources!!!!!!
User user = new User("eda"); 
System.out.log("orElse>> ");
User myUser = Optional.ofNullable(user).orElse(createUser());
System.out.log(myUser.getName());
System.out.log("orElseGet>> ");
User myUser = Optional.ofNullable(user).orElseGet( () -> createUser());
System.out.log(myUser.getName());

...
private User createUser() {
    logger.debug("createUser method inside");
    return new User("eda2");
}

/*
 Output:
  orElse>>
  createUser method inside
  eda
  orElseGet>>
  eda
*/

Return exception:
//orElseThrow() throws an exception if the object is empty:
User myUser = Optional.ofNullable(user).orElseThrow(() -> new UserDoesNotExist());

Mapping:
//map() method applies the functional argument to the value and returns the result.
User user = new User("eda"); 
String userName = Optional.ofNullable(user)
 .map(myUser -> myUser.getName()).orElse("DEFAULT NAME");

//if the get method returns an Optional value you can use flatMap() and return unwrapped String value.
public class User {    
    private String name;

    public Optional<String> getName() {
        return Optional.ofNullable(name);
    }

}

User user = new User("eda");
String userName = Optional.ofNullable(user)
 .flatMap(myUser -> myUser.getName()).orElse("DEFAULT NAME");

Filtering:
//filter() method
//optUser will not contain a null name value.
User user = new User(null);
Optional<User> optUser = Optional.ofNullable(user)
  .filter(myUser -> myUser.getName() != null);

//optUser.isPresent() is false, in this case filter returns empty Optional.

Features that come with Java 9 to Optional class:
Java 9 added 3 more methods to the Optional class:  or(), ifPresentOrElse() and stream().
or() method:
//orElse() and orElseGet() methods returns unwrapped values.
//or() method is similar with them but it returns Optional object.
User user = "eda"; 
Optional<User> myUser = Optional.ofNullable(user).or(() -> createUser());
//User myUser = Optional.ofNullable(user).or(() -> createUser()).get();
System.out.log(myUser.get().getName());
System.out.log("**");
...

User user = null; 
Optional<User> myUser = Optional.ofNullable(user).or(() -> createUser());
System.out.log(myUser.get().getName());
...

private Optional<User>  createUser() {
    logger.debug("createUser method inside");
    return Optional.of(new User("eda2"));
}

/*
 Output:
  eda
  **
  createUser method inside
  eda2
*/

ifPresentOrElse() method:
It gives us a change to run a function if the optional is empty.
Optional<User> opt = Optional.ofNullable(user);
opt.ifPresentOrElse(myUser -> 
    ///your other jobs, myUser.getName()
 , () -> logger.info("User not found")
);

stream() method:
I'll mention about stream in an another writing.
User user = new User("eda");
List<String> nameList = Optional.ofNullable(user)
   .stream()
   .filter(u -> u.getName() != null)
   .map(u -> u.getName())
   .collect(Collectors.toList());

Wednesday

Handling AJAX call error on client side

Just put the below code snippet to a JS file as below. (I used  immediately invoked functional expressions)

It is an error listener, it is called when JSF ajax request/response cyle gets an error.
(function jsfAjaxErrorHandler() {
 jsf.ajax.addOnError(function(data) {
   var log = "status:" +  data.status;
   log += " <br> message:" + data.message;
   log += " <br> description:" + data.description;
   log += " <br> serverErrorName:" + data.serverErrorName;
   log += " <br> serverErrorMessage:" + data.serverErrorMessage;
   log += " <br> source:" + data.source;
   log += " <br> responseCode:" + data.responseCode;
   log += " <br> responseText:" + data.responseText;
   log += " <br> responseXML:" + data.responseXML;
   
   alert(log);
 });
})();

Then load your js file but your js file must be loaded after JSF's own 'jsf.js' file.
<h:outputScript library="javax.faces" name="jsf.js"/>
<h:outputScript name="/yours.js" library="js"/> 

Sunday

Javascript - Functions and Objects

Let's talk a little about javascript functions and objects. I'll use Atom text editor, you can find lots off tutorial about using Atom.

Named functions:
function multiply(a,b) {
  var result = a*b;
  return result;
}

var multiplied = multiply(3,4);
console.log(multiplied);
console output:

12

function multiply(a,b) {
  var result =  ["my result:", a*b];
  return result;
}

var multiplied = multiply(3,4);
console.log(multiplied);
console.log(multiplied[0] + " >>>> " + multiplied[1]);
console output:

[ 'my result:', 12 ]
my result: >>>> 12

Anonymous functions:
var a = 4;
var b = 3;

 //only execute if we call the variable as if it is a function
var multiplied = function() {
  var result =  a*b;
  console.log(result);
}

// which means inside multiplied variable there is a anonymous function, run it!
multiplied();
console output:

12

//only execute if we call the variable as if it is a function
var multiplied = function(a,b) {
  var result =  ["my result:", a*b];
  return result;
}

// which means inside multiplied variable there is a anonymous function, run it!
console.log(multiplied(4,5));
console.log(multiplied);
console output: 

[ 'my result:', 20 ]
[Function: multiplied]

Immediately invoked functional expressions:
//inside the variable, we have an immediately  invoked function expression
//run the function with below arguments
var multiplied = (function(a,b) {
  var result =  ["my result:", a*b];
  return result;
})(4,5) // arguments are here

console.log(multiplied);
console output:

[ 'my result:', 20 ]

//result is NaN, why i'm in trouble?
//the browser runs the function(immediately invoked expressions) when it is encountered
//so the variables should be before the function
var multiplied = (function(a,b) {
  var result =  ["my result:", a*b];
  return result;
})(a,b) // arguments are here

var a = 3;
var b = 4;

console.log(multiplied);

variables:
***For scope control, you should always declare your variables using the var prefix.
There is a difference between var a = 1 and a = 1.
var a = 1 --> declares the variable in the current scope which can be local or global.
a = 1 --> if the variable couldn't be found anywhere in the scope chain, it becomes global.
This usage is very bad practice!!!

***With ES2015 two new types could be used:
const (cannot be changed once defined)
let (block scope variable. smaller scope then var)
















const MYCONSTANT = 3;
console.log(MYCONSTANT);

MYCONSTANT = 4; // gets error
console output:

3
[stdin]:6
MYCONSTANT = 4;
           ^

TypeError: Assignment to constant variable.
    at [stdin]:6:12
    at Script.runInThisContext (vm.js:96:20)

function example() {
  var localVariable = 4;

  if(localVariable) {
    var localVariable = "different localVariable"; //changes local variable for entire scope, to resolve that problem we should use type of let
    console.log("nested localVariable: " + localVariable);
  }

  console.log("localVariable: " + localVariable);
}

example();
console output:

nested localVariable: different localVariable
localVariable: different localVariable

function example() {
  var localVariable = 4; // or let localVariable = 4;

  if(localVariable) {
    let localVariable = "different localVariable";
    console.log("nested localVariable: " + localVariable);
  }

  console.log("localVariable: " + localVariable);
}

example();
console output:

nested localVariable: different localVariable
localVariable: 4

objects:
var ltmc = new Object();

var ltmc = {
  description: "Less Talk More Code",
  year: "2018",
  //objects can also have function that uses or changes object's properties
  updateYears: function() {
    return ++ltmc.year;
  }
}

// or you can define as below:
// ltmc.description = "Less Talk More Code";
// ltmc.year = "2018";

console.log("all object: " + ltmc);
console.log("one property of object: " + ltmc.description);

ltmc.updateYears();
console.log("updated: " + ltmc.year);
console output:

all object: [object Object]
one property of object: Less Talk More Code
updated: 2019

//object constructor examples
function Ltmc(description, year) {
  this.description = description;
  this.year = year;
  this.updateYears = function() { //anonymous function
    return ++this.year;
  };
}

var ltmc01 = new Ltmc("Less Talk More Code", "2018");
var ltmc02 = new Ltmc("Less Talk More Code2", "2019");
console.log(ltmc01);
console.log("************");
console.log(ltmc02);

var ltmcList = [
  new Ltmc("Less Talk More Code3", "2020"),
  new Ltmc("Less Talk More Code4", "2021"),
];

console.log("************");
console.log(ltmcList);
console output:

Ltmc {
  description: 'Less Talk More Code',
  year: '2018',
  updateYears: [Function] }
************
Ltmc {
  description: 'Less Talk More Code2',
  year: '2019',
  updateYears: [Function] }
************
[ Ltmc {
    description: 'Less Talk More Code3',
    year: '2020',
    updateYears: [Function] },
  Ltmc {
    description: 'Less Talk More Code4',
    year: '2021',
    updateYears: [Function] } ]

// ltmc01["year"]  -->  bracket notation example
//  ltmc01.year    and    ltmc01["year"]  are same

function Ltmc(description, year) {
  this.description = description;
  this.year = year;
}

var ltmc01 = new Ltmc("Less Talk More Code", "2018");

console.log(ltmc01["year"]);

I'll mention about closures in an another post.
(much more examples:  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures )

Tuesday

Sort multiple variables with Java 8 stream

I'll try to sort my data as following rules using java 8 stream.
Student.Address.CountryName = B or C is previous  >>
    then Student.StudentDetail.StudentScore descending (nulls  appear at the end) >>
       then Student.StudentDetail.RegistrationTime ascending

Example data:

The following code snippet makes sorting: 
 studentList.stream().sorted(
               Comparator.comparing((Student s)-> !Arrays.stream(priorityCountryName).anyMatch(s.address.getCountryName()::equals))
               .thenComparing(Comparator.comparing(s-> s.studentDetail.getStudentScore(), Comparator.nullsLast(Comparator.reverseOrder())))
               .thenComparing((s1) -> s1.studentDetail.getRegistrationTime())
)

Full example:
import java.io.Serializable;

public class Student implements Serializable {
    
    public final Address address;
    public final StudentDetail studentDetail;
    
    public Student(Address address, StudentDetail studentDetail) {
        this.address = address;
        this.studentDetail = studentDetail;
    }
}
import java.io.Serializable;

public class Address implements Serializable {
    
    private String countryName;
    
    public Address() {
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

}
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

public class StudentDetail implements Serializable {

    private int studentNumber;
    private BigDecimal studentScore;
    private Timestamp registrationTime;
    
    public StudentDetail(){
    }

    public BigDecimal getStudentScore() {
        return studentScore;
    }

    public void setStudentScore(BigDecimal studentScore) {
        this.studentScore = studentScore;
    }

    public Timestamp getRegistrationTime() {
        return registrationTime;
    }

    public void setRegistrationTime(Timestamp registrationTime) {
        this.registrationTime = registrationTime;
    }

    public int getStudentNumber() {
        return studentNumber;
    }

    public void setStudentNumber(int studentNumber) {
        this.studentNumber = studentNumber;
    }
    
}
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class Test {

    public static void main(String[] args) {
       String[] priorityCountryName = {"B", "C"};
 
       List<Student> studentList = addStudents();
       logStudentList("********studentList mix order**********", studentList);

       List<Student> orderedStudentList = studentList.stream().sorted(
               Comparator.comparing((Student s)-> !Arrays.stream(priorityCountryName).anyMatch(s.address.getCountryName()::equals))
               .thenComparing(Comparator.comparing(s-> s.studentDetail.getStudentScore(), Comparator.nullsLast(Comparator.reverseOrder())))
               .thenComparing((s1) -> s1.studentDetail.getRegistrationTime())
           ).collect(Collectors.toList());;
 
       logStudentList("********studentList ordered**********", orderedStudentList);
    }
    
    
    private static List<Student> addStudents() {
       List<Student> studentList = new ArrayList<Student>();
 
       Student student8 = new Student(new Address(), new StudentDetail());
       student8.address.setCountryName("D");
       student8.studentDetail.setStudentScore(new BigDecimal(5.0).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student8.studentDetail.setRegistrationTime(Timestamp.valueOf("2024-12-31 09:30:00"));
       student8.studentDetail.setStudentNumber(8);
       studentList.add(student8);
 
       Student student3 = new Student(new Address(), new StudentDetail());
       student3.address.setCountryName("B");
       student3.studentDetail.setStudentScore(new BigDecimal(0.1).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student3.studentDetail.setRegistrationTime(Timestamp.valueOf("2019-12-31 09:30:00"));
       student3.studentDetail.setStudentNumber(3);
       studentList.add(student3);
 
       Student student5 = new Student(new Address(), new StudentDetail());
       student5.address.setCountryName("B");
       student5.studentDetail.setStudentScore(null);
       student5.studentDetail.setRegistrationTime(Timestamp.valueOf("2018-12-31 09:30:00"));
       student5.studentDetail.setStudentNumber(5);
       studentList.add(student5);
 
       Student student2 = new Student(new Address(), new StudentDetail());
       student2.address.setCountryName("C");
       student2.studentDetail.setStudentScore(new BigDecimal(2.0).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student2.studentDetail.setRegistrationTime(Timestamp.valueOf("2021-12-31 09:30:00"));
       student2.studentDetail.setStudentNumber(2);
       studentList.add(student2);
 
       Student student7 = new Student(new Address(), new StudentDetail());
       student7.address.setCountryName("D");
       student7.studentDetail.setStudentScore(new BigDecimal(5.0).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student7.studentDetail.setRegistrationTime(Timestamp.valueOf("2023-12-31 09:30:00"));
       student7.studentDetail.setStudentNumber(7);
       studentList.add(student7);
 
       Student student4 = new Student(new Address(), new StudentDetail());
       student4.address.setCountryName("B");
       student4.studentDetail.setStudentScore(new BigDecimal(0.1).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student4.studentDetail.setRegistrationTime(Timestamp.valueOf("2020-12-31 09:30:00"));
       student4.studentDetail.setStudentNumber(4);
       studentList.add(student4);
 
       Student student9 = new Student(new Address(), new StudentDetail());
       student9.address.setCountryName("D");
       student9.studentDetail.setStudentScore(new BigDecimal(4.0).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student9.studentDetail.setRegistrationTime(Timestamp.valueOf("2025-12-31 09:30:00"));
       student9.studentDetail.setStudentNumber(9);
       studentList.add(student9);
 
       Student student1 = new Student(new Address(), new StudentDetail());
       student1.address.setCountryName("B");
       student1.studentDetail.setStudentScore(new BigDecimal(6.0).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student1.studentDetail.setRegistrationTime(Timestamp.valueOf("2022-12-31 09:30:00"));
       student1.studentDetail.setStudentNumber(1);
       studentList.add(student1);
 
       Student student10 = new Student(new Address(), new StudentDetail());
       student10.address.setCountryName("D");
       student10.studentDetail.setStudentScore(null);
       student10.studentDetail.setRegistrationTime(Timestamp.valueOf("2018-11-12 09:30:00"));
       student10.studentDetail.setStudentNumber(10);
       studentList.add(student10);
 
       Student student6 = new Student(new Address(), new StudentDetail());
       student6.address.setCountryName("E");
       student6.studentDetail.setStudentScore(new BigDecimal(5.0).setScale(2, BigDecimal.ROUND_HALF_EVEN));
       student6.studentDetail.setRegistrationTime(Timestamp.valueOf("2023-12-01 09:30:00"));
       student6.studentDetail.setStudentNumber(6);
       studentList.add(student6);
 
       return studentList;
    }
    
    private static void logStudentList(String firstMessage, List<Student> studentList) {
       System.out.println(firstMessage);
 
       for(Student student : studentList) {
          StringBuilder studentBuilder = new StringBuilder();
        
          studentBuilder.append("countryname: ");
          studentBuilder.append(student.address.getCountryName());
          studentBuilder.append(" studentNumber: ");
          studentBuilder.append(student.studentDetail.getStudentNumber());
          studentBuilder.append(" studentScore: ");
          studentBuilder.append(student.studentDetail.getStudentScore());
          studentBuilder.append(" registrationTime: ");
          studentBuilder.append(student.studentDetail.getRegistrationTime());
        
          System.out.println(studentBuilder.toString());
       }
    }

}

//CONSOLE OUTPUT:
********studentList mix order**********
countryname: D studentNumber: 8 studentScore: 5.00 registrationTime: 2024-12-31 09:30:00.0
countryname: B studentNumber: 3 studentScore: 0.10 registrationTime: 2019-12-31 09:30:00.0
countryname: B studentNumber: 5 studentScore: null registrationTime: 2018-12-31 09:30:00.0
countryname: C studentNumber: 2 studentScore: 2.00 registrationTime: 2021-12-31 09:30:00.0
countryname: D studentNumber: 7 studentScore: 5.00 registrationTime: 2023-12-31 09:30:00.0
countryname: B studentNumber: 4 studentScore: 0.10 registrationTime: 2020-12-31 09:30:00.0
countryname: D studentNumber: 9 studentScore: 4.00 registrationTime: 2025-12-31 09:30:00.0
countryname: B studentNumber: 1 studentScore: 6.00 registrationTime: 2022-12-31 09:30:00.0
countryname: D studentNumber: 10 studentScore: null registrationTime: 2018-11-12 09:30:00.0
countryname: E studentNumber: 6 studentScore: 5.00 registrationTime: 2023-12-01 09:30:00.0
********studentList ordered**********
countryname: B studentNumber: 1 studentScore: 6.00 registrationTime: 2022-12-31 09:30:00.0
countryname: C studentNumber: 2 studentScore: 2.00 registrationTime: 2021-12-31 09:30:00.0
countryname: B studentNumber: 3 studentScore: 0.10 registrationTime: 2019-12-31 09:30:00.0
countryname: B studentNumber: 4 studentScore: 0.10 registrationTime: 2020-12-31 09:30:00.0
countryname: B studentNumber: 5 studentScore: null registrationTime: 2018-12-31 09:30:00.0
countryname: E studentNumber: 6 studentScore: 5.00 registrationTime: 2023-12-01 09:30:00.0
countryname: D studentNumber: 7 studentScore: 5.00 registrationTime: 2023-12-31 09:30:00.0
countryname: D studentNumber: 8 studentScore: 5.00 registrationTime: 2024-12-31 09:30:00.0
countryname: D studentNumber: 9 studentScore: 4.00 registrationTime: 2025-12-31 09:30:00.0
countryname: D studentNumber: 10 studentScore: null registrationTime: 2018-11-12 09:30:00.0