Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/com/google/common/net/InternetDomainNameTest.java
package com.google.common.net;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class InternetDomainNameTest {

    @Test
    public void test() {
        assertTrue(InternetDomainName.isValid("ibm.d"));
        assertTrue(InternetDomainName.isValid("localhost"));
        assertTrue(InternetDomainName.isValid("surely.not.existing.a123781238923.com"));
        assertFalse(InternetDomainName.isValid(".me.localhost"));
        assertTrue(InternetDomainName.isValid("me.localhost."));
    }
}
-------------------------------------------------------------------------------
Test set: com.google.common.net.InternetDomainNameTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.027 s - in com.google.common.net.InternetDomainNameTest
test  Time elapsed: 0.027 s