To check if it is selected WebElement
or not, you can try:
String attr = driver.findElement(By.id("user-settings-price-preview-checkbox")).getAttribute("class");
if(attr.contains("active"))
System.out.println("WebElement selected");
else
System.out.println("WebElement NOT selected");
source
share