AccessStringHelper { public static boolean canWrite( String access ) { return isEnabled( access, Permission.WRITE ); } AccessStringHelper();  AccessStringHelper( char[] access );  AccessStringHelper( String access ); static AccessStringHelper newInstance(); static AccessStringHelper newInstance( char[] access ); AccessStringHelper enable( Permission permission ); AccessStringHelper disable( Permission permission ); String build(); String toString(); static boolean canRead( String access ); static boolean canDataRead( String access ); static boolean canWrite( String access ); static boolean canDataWrite( String access ); static boolean canReadAndWrite( String access ); static boolean canDataReadAndWrite( String access ); static boolean canReadOrWrite( String access ); static boolean canDataReadOrWrite( String access ); static boolean isEnabled( String access, Permission permission ); static boolean isValid( String access ); static boolean hasDataSharing( String access ); static void copySharing( T source, T target ); static final String DEFAULT; static final String CATEGORY_OPTION_DEFAULT; static final String CATEGORY_NO_DATA_SHARING_DEFAULT; static final String READ; static final String DATA_READ; static final String WRITE; static final String DATA_WRITE; static final String READ_WRITE; static final String DATA_READ_WRITE; static final String FULL; }
@Test public void testCanWrite() { String access1 = "rw------"; String access2 = "-w------"; String access_will_fail = "--------"; assertTrue( AccessStringHelper.canWrite( access1 ) ); assertTrue( AccessStringHelper.canWrite( access2 ) ); assertFalse( AccessStringHelper.canWrite( access_will_fail ) ); }