BigtableConfig implements Serializable { boolean isDataAccessible() { return getTableId().isAccessible() && (getProjectId() == null || getProjectId().isAccessible()) && (getInstanceId() == null || getInstanceId().isAccessible()); }  @Override String toString();  }
@Test public void testIsDataAccessible() { assertTrue( config .withTableId(TABLE_ID) .withProjectId(PROJECT_ID) .withInstanceId(INSTANCE_ID) .isDataAccessible()); assertTrue( config .withTableId(TABLE_ID) .withProjectId(PROJECT_ID) .withBigtableOptions(new BigtableOptions.Builder().setInstanceId("instance_id").build()) .isDataAccessible()); assertTrue( config .withTableId(TABLE_ID) .withInstanceId(INSTANCE_ID) .withBigtableOptions(new BigtableOptions.Builder().setProjectId("project_id").build()) .isDataAccessible()); assertTrue( config .withTableId(TABLE_ID) .withBigtableOptions( new BigtableOptions.Builder() .setProjectId("project_id") .setInstanceId("instance_id") .build()) .isDataAccessible()); assertFalse( config .withTableId(NOT_ACCESSIBLE_VALUE) .withProjectId(PROJECT_ID) .withInstanceId(INSTANCE_ID) .isDataAccessible()); assertFalse( config .withTableId(TABLE_ID) .withProjectId(NOT_ACCESSIBLE_VALUE) .withInstanceId(INSTANCE_ID) .isDataAccessible()); assertFalse( config .withTableId(TABLE_ID) .withProjectId(PROJECT_ID) .withInstanceId(NOT_ACCESSIBLE_VALUE) .isDataAccessible()); }