private final SampleFormatter sampleFormatter = new SampleFormatter() {
@Override
public String formatDouble (int tag, double Value, int pre) {
if (Double.isNaN(Value)) {
return "NaN";
}
if (Value == 0.0D) {
return "0";
} else {
return df.format(Value);
}
}
}
Here sample formatter is an interface and its method is implemented here.
How to get coverage for this format Double() method by writing testng test case.