EncodedRSAPublicKeyToBase64 implements Function<Object, String> { @Override public String apply(Object from) { String fromString = checkNotNull(from, "input").toString(); checkArgument(ALLOWED_MARKERS.apply(fromString), "must be a ssh public key, conforming to %s ", ALLOWED_MARKERS); return base64().encode(fromString.getBytes(UTF_8)); }  @Override String apply(Object from);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDisallowedMarkersIllegalArgument() throws IOException { function.apply("ssh-dsa"); }