### Question:
ResolveHostnameTransformer implements Transformer { @Override public String[] transform(final InputRow inputRow) { final String hostname = inputRow.getValue(hostnameColumn); String result = null; if (!StringUtils.isNullOrEmpty(hostname)) { try { final InetAddress addr = InetAddress.getByName(hostname); final byte[] ip = addr.getAddress(); assert ip.length == 4; result = toUnsigned(ip[0]) + "." + toUnsigned(ip[1]) + "." + toUnsigned(ip[2]) + "." + toUnsigned(ip[3]); } catch (final UnknownHostException e) { logger.error("Unknown host: " + hostname, e); } catch (final Exception e) { logger.error("Unexpected error", e); } } return new String[] { result }; }  @Override OutputColumns getOutputColumns(); @Override String[] transform(final InputRow inputRow);  }### Answer:
@Test public void testTransformLocal() throws Exception { assertEquals("127.0.0.1", _transformer.transform(new MockInputRow().put(_col, "localhost"))[0]); assertEquals("127.0.0.1", _transformer.transform(new MockInputRow().put(_col, "127.0.0.1"))[0]); assertEquals(null, _transformer.transform(new MockInputRow().put(_col, ""))[0]); assertEquals(null, _transformer.transform(new MockInputRow().put(_col, null))[0]); assertEquals(null, _transformer.transform(new MockInputRow().put(_col, "lmdslfsm flskmf lskmfls kmslf kdmlfsk mflsk fmsl kfdmsl"))[0]); }
@Test public void testTransformInternet() throws Exception { Assume.assumeTrue(TestHelper.isInternetConnected()); assertEquals("94.142.215.39", _transformer.transform(new MockInputRow().put(_col, "eobjects.org"))[0]); }