Password { static void generatePassword(String[] argv) throws Exception { if (argv == null || argv.length < 2) { System.out.println("Usage :"); System.err.println(" java " + Password.class.getCanonicalName() + " <style> <password>"); System.err.println(" where style is one of (trailing colon is required):"); for (String s : STYLES) { System.err.println(" " + s); } return; } PasswordCodec ph = create(argv[0]); String plainText = argv[1]; System.err.println("Cut and paste the following value where passwords are supported"); System.err.println("(should be a single line, with no spaces)"); System.err.println(ph.encode(plainText)); }  static PasswordCodec create(String type); static String decode(String encoded); static String encode(String plain, String type); static void main(String[] argv); static final String MSCAPI_STYLE; static final String PORTABLE_PASSWORD; static final String NON_PORTABLE_PASSWORD; }
@Test public void testMainClass() throws Exception { String[] args = { Password.PORTABLE_PASSWORD, TEXT }; Password.generatePassword(args); Password.generatePassword(null); Password.generatePassword(new String[0]); }