Implement the getAdapter/setAdapter methods in java