@Nullable
  public InetAddress get(String host) {
    if (!isValidHost(host)) {
      return null;
    }

    Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_HOSTS + " WHERE " + COLUMN_HOST  + " = ?;", new String[] {host});
    try {
      if (cursor.moveToNext()) {
        String ip = SqlUtils.getString(cursor, COLUMN_IP, null);
        return toInetAddress(host, ip);
      } else {
        return null;
      }
    } finally {
      cursor.close();
    }
  }
@Test
  public void testGet() {
    Hosts hosts = new Hosts(RuntimeEnvironment.application, "hosts.db");

    assertEquals(null, hosts.get("ni.hao"));
    hosts.put("ni.hao", "127.0.0.1");
    assertEquals("ni.hao/127.0.0.1", hosts.get("ni.hao").toString());

    assertEquals(null, hosts.get(null));
  }